1 | exports.port = 8848;
|
2 | exports.directoryIndexes = true;
|
3 | exports.documentRoot = __dirname;
|
4 | exports.getLocations = function () {
|
5 | return [
|
6 | {
|
7 | location: /\.php$/,
|
8 | handler: php()
|
9 | },
|
10 | {
|
11 | location: /\/$/,
|
12 | handler: home( 'index.html' )
|
13 | },
|
14 | {
|
15 | location: /^\/redirect-local/,
|
16 | handler: redirect('redirect-target', false)
|
17 | },
|
18 | {
|
19 | location: /^\/redirect-remote/,
|
20 | handler: redirect('http://www.baidu.com', false)
|
21 | },
|
22 | {
|
23 | location: /^\/redirect-target/,
|
24 | handler: content('redirectd!')
|
25 | },
|
26 | {
|
27 | location: '/empty',
|
28 | handler: empty()
|
29 | },
|
30 | {
|
31 | location: /\.css($|\?)/,
|
32 | handler: [
|
33 | autoless()
|
34 | ]
|
35 | },
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 | {
|
47 | location: /\.less($|\?)/,
|
48 | handler: [
|
49 | file(),
|
50 | less()
|
51 | ]
|
52 | },
|
53 | {
|
54 | location: /^.*$/,
|
55 | handler: [
|
56 | file(),
|
57 | proxyNoneExists()
|
58 | ]
|
59 | }
|
60 | ];
|
61 | };
|
62 |
|
63 | exports.injectResource = function ( res ) {
|
64 | for ( var key in res ) {
|
65 | global[ key ] = res[ key ];
|
66 | }
|
67 | };
|