-
Notifications
You must be signed in to change notification settings - Fork 1
/
router.js
77 lines (53 loc) · 2.3 KB
/
router.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*!
* birdway - route.js
* Copyright(c) 2012 dolphinboy <[email protected]>
* LGPL Licensed
*/
/**
* Module dependencies.
*/
var site = require('./src/action/business/homepage');
var user = require('./src/action/security/user_action');
var system = require('./src/action/system/system_action');
var travelplan = require('./src/action/business/travelplan');
var historicalstep = require('./src/action/business/historicalstep');
var userinfo = require('./src/action/business/usercenter/userinfo');
var datamanag = require('./src/action/business/usercenter/datamanag');
var sensor = require('./src/action/network/sensor_action');
module.exports.boot = function(server){
bootRouterServer(server);
};
function bootRouterServer(server) {
// home page
server.get('/', site.index);
server.get('/security/user_login', user.login); //用户登录
server.post('/security/user_login', user.login);
server.get('/security/user_regist', user.regist);
server.post('/security/user_regist', user.regist); //用户注册
server.get('/security/user_myinfo', user.myInfor); //显示个人信息
server.get('/system/verifycode', system.verifyCode);
// server.get('/gps/:uin/:lo/:la/:el', gpsserver.gps);
server.get('/business/travelplan', travelplan.mainpage); //旅游计划
server.get('/business/historicalstep', historicalstep.mainpage); //历史足迹
server.post('/business/historicalstep/searchstep', historicalstep.searchstep); //历史足迹
// server.all('/user/:id/:op?', function(req, res, next){
// req.user = users[req.params.id];
// if (req.user) {
// next();
// } else {
// next(new Error('cannot find user ' + req.params.id));
// }
// });
// server.get('*', function(req, res){
// console.log(req.url+' is called!');
// res.send('what???', 404);
// });
//测试版使用此路由来上传数据
server.get('/mobile/upload', sensor.uploadByGet);
server.get('/mobile/userid', sensor.getUserId);
//*****用户中心*****
server.get('/business/usercenter/userinfo_base', userinfo.baseinfo); //用户信息
server.get('/business/usercenter/datamanag_import', datamanag.import);
server.post('/business/usercenter/datamanag_import', datamanag.import);
server.get('/data/show', sensor.showSensorData);
};