Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Procfile issue #122

Open
f-ke opened this issue Oct 14, 2020 · 2 comments
Open

Procfile issue #122

f-ke opened this issue Oct 14, 2020 · 2 comments

Comments

@f-ke
Copy link

f-ke commented Oct 14, 2020

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?

@basir
Copy link
Owner

basir commented Oct 19, 2020 via email

@f-ke
Copy link
Author

f-ke commented Oct 19, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants