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

How to deploy? #280

Closed
ThekhoN opened this issue May 25, 2017 · 5 comments
Closed

How to deploy? #280

ThekhoN opened this issue May 25, 2017 · 5 comments

Comments

@ThekhoN
Copy link

ThekhoN commented May 25, 2017

I tried to deploy a simple counter app (based-off the redux example) with some actual API call to get and update the count.
https://github.com/ThekhoN/razzle-react-redux-starter
Correct me if i'm wrong, the only requirement for deployment is the /build folder after running
npm run build?
When i try to do node server.js, it keeps throwing module errors : "Cannot find module 'react'" etc.
Can some one explain how to resolve this so that i can safely deploy the example?
Thanks.

@jaredpalmer
Copy link
Owner

Hey so you def do not want to check in the build directory to git. So you should add that back to gitignore. Where are you trying to deploy?

@ThekhoN
Copy link
Author

ThekhoN commented May 25, 2017

Thanks for getting back. i will remove it.
I actually intend to deploy it on a droplet on Digital Ocean.
Meanwhile I had tried to deploy it on heroku, using the git, but it failed.
https://devcenter.heroku.com/articles/git

@jaredpalmer
Copy link
Owner

@ThekhoN I went ahead and made the PR's to your example repo so you can deploy to Heroku.

@jaredpalmer
Copy link
Owner

So the issue had to do with how Heroku forces you to use their process.env.PORT, which is only set after the heroku's build completes.
These are changes you should make for Heroku: ThekhoN/razzle-react-redux-starter#3

Can confirm that this works... https://razzle-redux-starter.herokuapp.com/

@ThekhoN
Copy link
Author

ThekhoN commented May 26, 2017

Thanks so much for taking the time to make this work :)

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