From 66c68254b4c213fcfc03ce081c47d24bcd42bbd3 Mon Sep 17 00:00:00 2001 From: BoHong Li Date: Wed, 12 Apr 2017 05:38:54 +0800 Subject: refactor(app.js): Extract index, 403, 404, 500 pages --- app.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'app.js') diff --git a/app.js b/app.js index b00f37b4..f5f95573 100644 --- a/app.js +++ b/app.js @@ -199,20 +199,6 @@ app.set('views', path.join(__dirname, '/public/views')) app.engine('ejs', ejs.renderFile) // set view engine app.set('view engine', 'ejs') -// get index -app.get('/', response.showIndex) -// get 403 forbidden -app.get('/403', function (req, res) { - response.errorForbidden(res) -}) -// get 404 not found -app.get('/404', function (req, res) { - response.errorNotFound(res) -}) -// get 500 internal error -app.get('/500', function (req, res) { - response.errorInternalError(res) -}) // get status app.get('/status', function (req, res, next) { realtime.getStatus(function (data) { @@ -430,6 +416,7 @@ if (config.email) { }) }) } +app.use(require('./lib/web/baseRouter')) app.post('/login', urlencodedParser, function (req, res, next) { if (!req.body.email || !req.body.password) return response.errorBadRequest(res) -- cgit v1.2.3