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