Это то, что я положил в мой node.js / express.js
const port = process.env.PORT || 2000;
app.listen(port, () => {
console.log("App is running on port " + port);
});
if(process.env.NODE_ENV === 'production'){
//set static folder
app.use(express.static('cr-follow-up/build'));
app.get('*', (req, res) => {
const index = path.join(__dirname, 'build', 'index.html');
res.sendFile(index);
})
}
Это то, что я положил в свой package.json в моем index.jsфайл для узла / экспресс
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix cr-
follow-up && npm run build --prefix cr-follow-up"
![enter image description here](https://i.stack.imgur.com/AVn5N.png)