SIMPLE | How to Deploy a Full-Stack app to Heroku

Published: 31 October 2021
on channel: Brady Bott
1,448
23

A simple way to deploy a React App and Database to Heroku (Code provided below)

🔴These two lines of code go in your main server file:

app.use(express.static(path.resolve(__dirname, "../build")));

app.get('/*', function (req, res) {
res.sendFile(path.join(__dirname, '../build', 'index.html'));
});

🔴These two lines of code go in your package.json:

"main": "./server/index.js",

"start": "node ./server/index.js && npm build",


Watch video SIMPLE | How to Deploy a Full-Stack app to Heroku online without registration, duration hours minute second in high quality. This video was added by user Brady Bott 31 October 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,448 once and liked it 23 people.