Skip to content

Instantly share code, notes, and snippets.

@radiodario
Forked from PunkChameleon/gist:6306598
Last active December 21, 2015 12:38
Show Gist options
  • Save radiodario/6306607 to your computer and use it in GitHub Desktop.
Save radiodario/6306607 to your computer and use it in GitHub Desktop.
// On index.js
//Configure Body Parser
app.configure(function() {
app.use(express.cookieParser())
app.use(express.session({
key: "QAWdefrAQ",
secret: 'asfyvhq987ertvyweiurytsdfgadekjr4yhtfsdfgt9jfwe3ht987234yh'
}))
app.use(express.bodyParser())
app.use('/gb-admin', require('./routes/gb-admin'));
app.use(app.router)
//Set up Static File for Components
app.use(express.static(__dirname + '/public'))
})
// gb-admin.js
var auth = require('../lib/auth.js')
var app = module.exports = express.createServer();
var html_dir = '../lib/views/'
//Edit page
app.get('/gb-admin/edit', auth.check, function (req, res) {
res.sendfile(html_dir + 'edit.html')
})
//Config Page
app.get('/gb-admin/config', auth.check, function (req, res) {
res.sendfile(html_dir + 'config.html')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment