Dindaleon / hapi-react-starter-kit

A hapi React Starter kit with react-router, redux, react-transform
172 stars 29 forks source link

Question: heroku guide #11

Closed zebapy closed 8 years ago

zebapy commented 8 years ago

Do you have any basics on the Heroku deployment guide to share before the actual guide comes? I've been attempting to deploy a lighter variation of this app on Heroku with no luck .. I'm getting Heroku's Error R10. Surely it's something within my app I've missed but I'd like to hear the details on what it takes for this repo to get deployed on Heroku if possible.

Thanks

Dindaleon commented 8 years ago

Are you using redis with your version? Because I have difficulties setting up redis on heroku.

zebapy commented 8 years ago

No. I'm using Mongoose which talks to a MongoDb install on compose.io elsewhere. I removed the connection for that completely and still have an app error.

Dindaleon commented 8 years ago

I haven't written anything yet but I will let you know as soon as I get some done.

zebapy commented 8 years ago

Really strange but I found my app crashes if I used const HOST = process.env.HOST || 'localhost'; From what I can tell, it needed to be ... || '0.0.0.0'; instead. By looking at your app, I see you use localhost. Im confused..

Dindaleon commented 8 years ago

Look here: https://github.com/Dindaleon/hapi-react-starter-kit/blob/master/src/globals.js#L32-L34

You should replace those two lines with your heroku host.

zebapy commented 8 years ago

That's reliant on your setting those variables in your heroku admin, right? Wouldn't there be a way to just automatically get the host (like process.env.HOST)?

Dindaleon commented 8 years ago

OpenShift itself sets those variables OPENSHIFT_NODEJS_IP and OPENSHIFT_NODEJS_PORT check if heroku has them already set or you have to set them manually. I have no experience deploying on Heroku yet.

Dindaleon commented 8 years ago

@zebapy were you able to get it running on heroku?

zebapy commented 8 years ago

I got my version of a hapi / react / api app running yes. I just removed the host in connection options

Dindaleon commented 8 years ago

I believe they are using localhost so yes, you do not need to have that option set; however, it should have worked with the default settings, as the default is set to use localhost

I am glad that you got it to run.