Skip to content
Snippets Groups Projects
Commit 8ac9892d authored by TriggerRimfire's avatar TriggerRimfire
Browse files

init

parents
No related branches found
No related tags found
No related merge requests found
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
app.js 0 → 100644
const express = require('express')
const app = express()
const session = require('express-session')
const passport = require('passport')
const bodyParser = require('body-parser')
const path = require('path')
const utils = require('./lib/utils.js')
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'pug')
app.set('port', process.env.PORT || 3000)
app.use(express.static(path.join(__dirname, 'public')))
// --- ROUTES ---
app.use('/', require('./controllers/index'))
app.use(session({
secret: 'owo_what_a_secret',
resave: true
}))
app.use(passport.initialize())
app.use(passport.session())
//handle 404
app.use( (req, res, next) => {
res.status(400)
res.send('http://dean.is-a.dog') //hi dean
})
app.use( (req, res, next) => {
res.status(500)
})
app.listen(app.get('port'), () => {
console.log('Listening on port: ', app.get('port'))
})
module.exports = {
'auth' : {
'google' : {
'callback_url' : 'callback_url',
'client_id' : 'client_id',
'client_secret' : 'client_secret'
}
}
}
const express = require('express') //im lazy sorry
const index = express.Router()
index.get('/', (req, res) => {
res.render('index')
})
module.exports = index
const gulp = require('gulp')
const nodemon = require('gulp-nodemon')
const notify = require('gulp-notify')
const sass = require('gulp-sass')
const babel = require('gulp-babel')
const sync = require('browser-sync')
const reload = sync.reload
//ALL DEV STUFF NOT FOR PRODUCTION PLS NO TOUCH
//-- TASKS
gulp.task('babel', () => {
return gulp.src('./src/js/*.js')
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest('./public/js'))
})
gulp.task('browser-sync', ['nodemon'], () => {
sync.init(null, {
proxy: "localhost:3000",
port: 5000,
notify: true
})
})
gulp.task('css', () => {
return gulp.src('./src/scss/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./public/css'))
.pipe(reload({stream:true}))
})
gulp.task('nodemon', (callback) => {
return nodemon({script: 'app.js'}).on('start', callback)
})
gulp.task('serve', ['css', 'browser-sync'], () => {
sync.init({
server: "./app"
})
gulp.watch('./src/scss/*.scss', ['css'])
})
//utility functions
//i'll make an example here later for oauth shenanigans owo
{
"name": "owo_controlpanel",
"version": "0.0.1",
"description": "control panel for owo",
"main": "gulp",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.15.2",
"express": "^4.14.0",
"express-session": "^1.14.2",
"passport": "^0.3.2"
}
}
//make you a javascript here
//get SASSy here bby ;)
footer
h1 am the footer hi
header
h1 hi bby am a header
extends layout
block content
div
h1 hi bby am content
html
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
meta(name='viewport', content='width=device-width, initial-scale=1')
title do a title here fam
link(rel='stylesheet', href='https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.css')
link(rel='stylesheet', href='/css/main.css')
body
section.page
include includes/header
block content
include includes/footer
script(type='text/javascript' src='/js/main.js')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment