-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.js
69 lines (67 loc) · 1.57 KB
/
init.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
const RouteManager = require("./lib/creator");
/**
* Example usage of schematic builder, just use `node init.js` to execute ^^
*/
new RouteManager().schematicBuilder.create("./routes", {
user: {
create: {
method: "post",
body: {
email: {
type: "string",
minLength: 10,
maxLength: 30
},
login: {
type: "string",
minLength: 10,
maxLength: 20
},
password: {
type: "string",
minLength: 8,
maxLength: 64
}
},
query: {
proxy: {
type: "string",
length: 16
}
}
},
edit: {
method: "post",
body: {
id: {
type: "string"
},
login: {
type: "string"
},
email: {
type: "string"
}
}
},
delete: {
method: "delete",
body: {
id: {
type: "string"
}
}
},
getAll: {
method: "get"
},
get: {
method: "get",
query: {
id: {
type: "string"
}
}
}
}
})