added dev and prod scripts, serve static content
This commit is contained in:
parent
b5c31ddf25
commit
6a5abcbe70
@ -4,7 +4,9 @@
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "webpack-dev-server --config ./webpack.config.js --mode development",
|
||||
"dev": "webpack-dev-server --config ./webpack.config.js --mode development",
|
||||
"build": "webpack --config ./webpack.config.js --mode production",
|
||||
"prod": "node server.js",
|
||||
"test": "echo \"No test specified\" && exit 0"
|
||||
},
|
||||
"keywords": [],
|
||||
@ -38,4 +40,4 @@
|
||||
"redux-logger": "^3.0.6",
|
||||
"redux-thunk": "^2.3.0"
|
||||
}
|
||||
}
|
||||
}
|
@ -17,9 +17,9 @@ app.use(express.static(path.join(__dirname, 'dist')))
|
||||
//http://localhost:31337
|
||||
app.use(proxy('/api', { target: 'http://localhost:1337' }))
|
||||
|
||||
// app.get('*', (req, res) => {
|
||||
// res.sendFile(path.resolve(__dirname, 'dist', 'index.html'))
|
||||
// })
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(path.resolve(__dirname, 'dist', 'index.html'))
|
||||
})
|
||||
|
||||
// error handling endware
|
||||
app.use((err, req, res, next) => {
|
||||
|
Loading…
Reference in New Issue
Block a user