-
Notifications
You must be signed in to change notification settings - Fork 241
/
server.js
47 lines (41 loc) · 1.04 KB
/
server.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
const Path = require('path');
const Express = require('express');
var ServeIndex = require('serve-index');
const Webpack = require('webpack');
const WebpackMiddleware = require('webpack-dev-middleware');
const compiler = Webpack([
{
entry: {
'stage.web': './platform/web.js',
'stage.cordova': './platform/cordova.js',
},
output: {
library: 'Stage',
filename: '[name].js',
},
devtool: 'source-map',
optimization: {
minimize: false
},
plugins: [
new Webpack.DefinePlugin({
DEBUG: JSON.stringify(false),
ASSERT: JSON.stringify(true),
}),
],
}
]);
var app = Express();
app.set('port', process.env.PORT || 6588);
app.use(WebpackMiddleware(compiler, {
publicPath: '/dist/',
compress: false,
}));
app.use(Express.static(Path.resolve(__dirname)));
app.use(ServeIndex(__dirname, {
icons : true,
css : 'ul#files li{float:none;}' // not actually working!
}));
app.listen(app.get('port'), function() {
console.log('Checkout http://localhost:' + app.get('port'));
});