65 lines
1.4 KiB
JavaScript
65 lines
1.4 KiB
JavaScript
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 ];
|
|
}
|
|
};
|