Skip to content

Instantly share code, notes, and snippets.

@PunkChameleon
Created August 22, 2013 12:35
Show Gist options
  • Save PunkChameleon/6306598 to your computer and use it in GitHub Desktop.
Save PunkChameleon/6306598 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(app.router)
//Set up Static File for Components
app.use(express.static(__dirname + '/public'))
app.use('/gb-admin', './routes/gb-admin.js');
})
// gb-admin.js
var auth = require('../lib/auth.js')
module.exports = function(app) {
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