add server config
This commit is contained in:
64
edp-webserver-config.js
Normal file
64
edp-webserver-config.js
Normal file
@@ -0,0 +1,64 @@
|
||||
exports.port = 8008;
|
||||
exports.directoryIndexes = true;
|
||||
exports.documentRoot = __dirname;
|
||||
exports.getLocations = function () {
|
||||
return [
|
||||
{
|
||||
location: /\/$/,
|
||||
handler: home( 'index.html' )
|
||||
},
|
||||
{
|
||||
location: /^\/redirect-local/,
|
||||
handler: redirect('redirect-target', false)
|
||||
},
|
||||
{
|
||||
location: /^\/redirect-remote/,
|
||||
handler: redirect('http://www.baidu.com', false)
|
||||
},
|
||||
{
|
||||
location: /^\/redirect-target/,
|
||||
handler: content('redirectd!')
|
||||
},
|
||||
{
|
||||
location: '/empty',
|
||||
handler: empty()
|
||||
},
|
||||
{
|
||||
location: /\.css($|\?)/,
|
||||
handler: [
|
||||
autocss({
|
||||
less: {
|
||||
relativeUrls: false
|
||||
}
|
||||
})
|
||||
]
|
||||
},
|
||||
{
|
||||
location: /\.less($|\?)/,
|
||||
handler: [
|
||||
file(),
|
||||
less()
|
||||
]
|
||||
},
|
||||
{
|
||||
location: /\.styl($|\?)/,
|
||||
handler: [
|
||||
file(),
|
||||
stylus()
|
||||
]
|
||||
},
|
||||
{
|
||||
location: /^.*$/,
|
||||
handler: [
|
||||
file(),
|
||||
proxyNoneExists()
|
||||
]
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
exports.injectResource = function ( res ) {
|
||||
for ( var key in res ) {
|
||||
global[ key ] = res[ key ];
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user