bootstarp.js
1.0 KB
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
/*
* @Descripttion:
* @version: 0.0.0
* @Author: genglw
* @Date: 2022-01-21 15:31:14
* @LastEditors: genglw
* @LastEditTime: 2022-02-10 20:46:00
*/
// app - routes
var bootable = require('bootable');
exports = module.exports = function(IoC, settings) {
var app = this;
//auth
app.phase(bootable.di.routes('./routes/auth.js'));
//mock
app.phase(bootable.di.routes('./routes/mock.js'));
//authed
app.phase(bootable.di.routes('./routes/authed.js'));
//api
app.phase(bootable.di.routes('./routes/api.js'));
//file
app.phase(bootable.di.routes('./routes/file.js'));
//robot
app.phase(bootable.di.routes('./routes/robot.js'));
//excellent
app.phase(bootable.di.routes('./routes/excellent.js'));
app.phase(bootable.di.routes('./routes/config.js'));
// error handler (always keep this last)
app.phase(function() {
var errorHandler = IoC.create('igloo/error-handler');
app.use(errorHandler);
});
};
exports['@require'] = [ '$container', 'igloo/settings' ];