Procfile issue
Hi sir, I am confused that it seems like my Procfile does not work after I deploy to heroku. it still starts wit the start script and contributes to a crash. I put the Procfile in the root directory and I am sure the content is the same with you. Could you give me some suggestion to deal with this problem?
Share your code to take a look
On Wed, Oct 14, 2020 at 7:14 PM f-ke [email protected] wrote:
Hi sir, I am confused that it seems like my Procfile does not work after I deploy to heroku. it still starts wit the start script and contributes to a crash. I put the Procfile in the root directory and I am sure the content is the same with you. Could you give me some suggestion to deal with this problem?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/basir/node-react-ecommerce/issues/122, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATUFQ24SJEXKRYPZOV6XQ3SKXBPFANCNFSM4SQZC3YA .
https://github.com/f-ke/online-mall-like-amazon-react-node-redux- Hi sir, I have successfully fix the procfile issue. But I have got a new issue: not found. Log told me it can not find the build foler in frontend. the link of my repo is above. The package.json I set is below: `{ "name": "amazon", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "start": "nodemon --watch backend --exec babel-node backend/server.js", "build": "rm -rf dist && babel backend -d dist ", "heroku-postbuild-x": "npm run build && cd frontend && npm install && npm run build" },
"author": "", "license": "ISC", "dependencies": { "body-parser": "^1.19.0", "dotenv": "^8.2.0", "express": "^4.17.1", "jsonwebtoken": "^8.5.1", "mongoose": "^5.10.3" }, "engines": { "node": "12.4.0", "npm": "6.9.0" },
"devDependencies": {
"@babel/cli": "^7.10.5",
"@babel/core": "^7.11.4",
"@babel/node": "^7.10.5",
"@babel/preset-env": "^7.11.0",
"nodemon": "^2.0.4"
}
}the server.js I have edited is below:app.use(express.static(path.join(__dirname, '/../frontend/build')));
app.get('*', (req, res) => {
res.sendFile(path.join(${__dirname}/../frontend/build/index.html));
});
app.listen(config.PORT, ()=>{
console.log("server start sucessfully at localhost:5000");
}
);`
It would be appreciated if you can give me some suggestions.