-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest5.js
105 lines (66 loc) · 1.87 KB
/
test5.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<<<<<<< HEAD
=======
// var routeruser = require('moa-router')()
>>>>>>> 423a8b3eea68ba0a0f20685aeaf40e25edbc8fd4
const http = require('http')
const Koa = require('koa')
const app = new Koa()
<<<<<<< HEAD
const router = require('./routes/api/')
router.tree.prefix = '/api/'
=======
// routeruser.tree.prefix = '/users/'
// const router = require('./routes/api/users')
>>>>>>> 423a8b3eea68ba0a0f20685aeaf40e25edbc8fd4
// require('log-n')(router)
<<<<<<< HEAD
// require('log-n')(routeruser);
=======
// wrap(routeruser, '/api/', router)
// function wrap(parent, prefix, router) {
// var empty = require('moa-router')()
// empty.tree.prefix = prefix
// router.tree.prefix = prefix
// var arr = parent.tree.children
// arr = arr.concat(router.tree)
// console.log(router)
// empty.tree.children = arr //.concat(router.tree.children)
// empty.tree.numberOfChildren = arr.length
// require('log-n')(empty);
// var all = empty.tree.children
// console.log(all)
// console.log(parent.tree.children)
// parent.tree.children = all.concat(parent.tree.children)
// parent.tree.numberOfChildren = all.length
// require('log-n')(parent);
// }
// const http = require('http')
// const Koa = require('koa')
// const app = new Koa()
// // require('log-n')(routeruser);
// app.use(routeruser.routes())
// app.listen(3000)
>>>>>>> 423a8b3eea68ba0a0f20685aeaf40e25edbc8fd4
const router2 = require('./routes/')
router2.tree.prefix = '/'
<<<<<<< HEAD
app.use(router2.routes())
require('log-n')(router2)
=======
>>>>>>> 423a8b3eea68ba0a0f20685aeaf40e25edbc8fd4
app.use(router.routes())
<<<<<<< HEAD
=======
var a = {
on: function (aa) {
console.log(aa)
},
f: function () {
console.log(f)
original.apply(this, arguments);
return this.on.apply(this, arguments);
}
}
var origin = a.on
>>>>>>> 423a8b3eea68ba0a0f20685aeaf40e25edbc8fd4
a.on('23332')