Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Heroku_Deployment

Deployment

  • Add to the app.js the following:
const path = require("path");
app.use('/', express.static(path.join(__dirname, '/frontend/build')));

app.get("*", (req, res) => {
  res.sendFile(path.resolve(__dirname, "frontend/build/index.html"));
});

const PORT = process.env.PORT || 3001;
app.listen(PORT);
  • Add to package json backend in the script:
    "dev": "npx nodemon app.js",
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "cd frontend && npm run build",
    "install-client": "cd frontend && npm install",
    "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm run install-client && npm run build",
    "client": "cd frontend && npm start",
    "start": "node app.js"

  • Connect to your GitHub repo

  • Deploy

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors