-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathroutes.js
24 lines (21 loc) · 865 Bytes
/
routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var main = require('./controllers/main');
var board = require('./controllers/board');
var article = require('./controllers/article');
var page = require('./controllers/page');
var login = require('./controllers/login');
//处理所有的路由请求
exports = module.exports = function(app) {
app.get ('/' , main.index);
app.get ('/login' , login.index);
app.get ('/logout' , login.logout);
app.post ('/login' , login.check);
app.get ('/bbsdoc' , board.list);
app.get ('/bbscont/:id' , article.view);
app.get ('/page/:id' , page.next);
app.get ('/next/:id' , page.redir);
app.get ('/prev/:id' , page.redir);
app.get ('/file/*' , article.file);
app.all('/*',function (req,res,next){
res.render('404',{layout:false})
})
}