forked from cmmcleod/coriolis
-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathdevServer.js
More file actions
executable file
·33 lines (29 loc) · 856 Bytes
/
devServer.js
File metadata and controls
executable file
·33 lines (29 loc) · 856 Bytes
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
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('./webpack.config.dev');
const devServerOptions = {
hot: true,
headers: {
"Access-Control-Allow-Origin": "*"
},
historyApiFallback: {
rewrites: [
// For some reason connect-history-api-fallback does not allow '.' in the URL for history fallback...
{ from: /\/outfit\//, to: '/index.html' }
]
},
host: '0.0.0.0',
port: 3300
};
const compiler = webpack(config);
const server = new WebpackDevServer(devServerOptions, compiler);
const runServer = async () => {
console.log('Starting development server...');
try {
await server.start();
console.log('Successfully started server on http://localhost:3300');
} catch (err) {
console.log('Error starting server:', err);
}
};
runServer();