-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
81 lines (66 loc) · 1.28 KB
/
config.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
var route = require('./core/route');
exports.CONTENT_TYPE = {
css: 'text/css',
gif: 'image/gif',
html: 'text/html; charset=UTF-8',
jpe: 'image/jpeg',
jpeg: 'image/jpeg',
jpg: 'image/jpeg',
js: 'application/x-javascript',
png: 'image/png',
text: 'text/plain; charset=UTF-8',
ico: 'image/x-icon'
};
exports.ROOT = __dirname;
exports.STATIC_FILE_DIR = 'statics';
exports.VIEWS_DIR = 'views';
exports.FAVICON = '/favicon.png';
exports.POST_DIR = 'post';
exports.DOMAIN = 'localhost';
route.map({
rule: /^\/$/i,
controller: 'index',
action: 'index',
method: 'get',
arguments: 1
});
route.map({
rule: /^\/index\/?\d*\/?/i,
controller: 'index',
action: 'index',
method: 'get',
arguments: 1
});
route.map({
rule: /^\/$/i,
controller: 'index',
action: 'index',
method: 'post',
arguments: 1
});
route.map({
rule: /^\/index\/?\d*\/?/i,
controller: 'index',
action: 'index',
method: 'post',
arguments: 1
});
route.map({
rule: /^\/(article)(\/)?[\w-_]*\/?/i,
controller: 'article',
action: 'article',
arguments: ''
});
route.map({
rule: /^\/about\/*$/i,
controller: 'about',
action: 'about',
arguments: ''
});
route.map({
rule: /^\/fetch\/?\d*\/?/i,
controller: 'fetch',
action: 'start',
method: 'get',
arguments: 1
});