-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
28 lines (25 loc) · 709 Bytes
/
Copy pathserver.js
File metadata and controls
28 lines (25 loc) · 709 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
const webpack = require('webpack')
const WebpackDevServer = require('webpack-dev-server')
const config = require('./webpack.config')
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
inline: true,
historyApiFallback: {
index: 'landing.html',
rewrites: [
{ from: /^\/profile/, to: '/profile.html' },
{ from: /^\/tc/, to: '/tc.html' },
{ from: /^\/pp/, to: '/pp.html' },
{ from: /^\/r/, to: '/landing.html' },
],
},
headers: {
'Access-Control-Allow-Origin': '*',
},
}).listen(8080, 'localhost', (err, result) => {
if (err) {
return console.log(err)
}
console.log('Listening at http://localhost:8080/')
})