-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest3.js
74 lines (44 loc) · 1.17 KB
/
test3.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
// console.dir(a.tree.children)
// console.dir(a.tree.children[0])
// console.dir(a.tree.children[0].children)
// console.log = function(msg){
// require('log-n')(msg)
// }
console.log(require('./test4'))
// var routeruser = require('moa-router')()
// routeruser.get('/', (ctx, next) => {
// ctx.body = {
// 'path': 'root'
// }
// })
// routeruser.get('/list', (ctx, next) => {
// ctx.body = {
// 'path': '/list'
// }
// })
// routeruser.tree.prefix = '/users/'
// const router = require('moa-router')()
// router.get('/', (ctx, next) => {
// ctx.body = {
// 'path': 'root'
// }
// })
// router.get('/users/list', (ctx, next) => {
// ctx.body = {
// 'path': 'users/users/list'
// }
// })
// var arr = routeruser.tree.children
// for (var i in all) {
// var r = all[i]
// arr = arr.concat(r.obj.tree.children)
// // console.log(arr)
// routeruser.tree.children = arr //.concat(router.tree.children)
// routeruser.tree.numberOfChildren = arr.length
// }
// const http = require('http')
// const Koa = require('koa')
// const app = new Koa()
// require('log-n')(routeruser);
// app.use(routeruser.routes())
// app.listen(3000)