closes #8 - admin redirects

Adding a regex to match lots of different admin URLs and redirect them to /ghost/
This commit is contained in:
Hannah Wolfe 2013-05-18 23:03:57 +01:00
parent 63df17b534
commit 8b3ea85bd4

13
app.js
View File

@ -12,13 +12,11 @@
flash = require('connect-flash'),
Ghost = require('./core/ghost'),
I18n = require('./core/lang/i18n'),
helpers = require('./core/frontend/helpers');
var auth,
helpers = require('./core/frontend/helpers'),
// ## Variables
auth,
/**
* Create new Ghost object
* @type {Ghost}
@ -68,7 +66,10 @@
ghost.app().get('/ghost/debug', auth, admin.debug.index);
ghost.app().get('/ghost/debug/db/delete/', auth, admin.debug.dbdelete);
ghost.app().get('/ghost/debug/db/populate/', auth, admin.debug.dbpopulate);
ghost.app().get('/ghost', auth, admin.index);
ghost.app().get(/^\/(ghost$|(ghost-admin|admin|wp-admin|dashboard|login)\/?)/, auth, function (req, res) {
res.redirect('/ghost/');
});
ghost.app().get('/ghost/', auth, admin.index);
/**
* Frontend routes..