how to deploy flask app on heroku code example
Example 1: how to deploy heroku app
I assume you know how to use git.
I also assume you've ran the heroku create command for the app.
First commit the app if you haven't, then run this command:
git push heroku master
If there's an error, then try to fix it.
After that access the website by running this command:
heroku open
And run this command if you encounter an error with the website:
heroku logs --tail
Example 2: deploy react app to heroku
const path = require('path');const express = require('express');const app = express();const publicPath = path.join(__dirname, '..', 'public');const port = process.env.PORT || 3000;app.use(express.static(publicPath));app.get('*', (req, res) => { res.sendFile(path.join(publicPath, 'index.html'));});app.listen(port, () => { console.log('Server is up!');});