-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.js
More file actions
37 lines (31 loc) · 762 Bytes
/
Copy pathindex.js
File metadata and controls
37 lines (31 loc) · 762 Bytes
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
'use strict';
const server = require('./server/server');
const middle = require('./middleware/middleware');
class Dufing {
constructor(obj) {
const port = obj.port || 8124;
server.call(this, port);
// loader default middleware
this.use({
response: {},
jade: {},
session: {},
hbs:{}
})
}
use(middles) {
for (var i in middles) {
let obj = {
name: i,
config: middles[i]
}
middle.add.call(this, obj);
}
}
// customer router
get(path, file) {
this.routerGet = this.routerGet || [];
this.routerGet.push([path, file])
}
}
module.exports = Dufing;