Skip to content

Commit

Permalink
add deploy script close #87
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammedagha27 committed Sep 29, 2022
1 parent ed12ca9 commit ee4783c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"client": "cd client && npm start",
"dev": "cross-env NODE_ENV=development nodemon ./src",
"format": "prettier --write **/*.js",
"heroku-postbuild": "cd client && npm install && npm run build",
"lint": "npx eslint **/*.js"
},
"repository": {
Expand Down
1 change: 1 addition & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ app.disable('x-powered-by');
app.use('/api/v1', router);

if (process.env.NODE_ENV === 'production') {
app.use(express.static(join(__dirname, '..', 'client', 'build')));
app.use('*', (req, res) => {
res.sendFile(join(__dirname, '..', 'client', 'build', 'index.html'));
});
Expand Down

0 comments on commit ee4783c

Please sign in to comment.