mapbox / analysis-demos

ISC License
79 stars 47 forks source link

Deploy to heroku #10

Closed rimager closed 7 years ago

rimager commented 8 years ago

I apologize in advance if this question is beyond the scope of what you could answer.

I see you use budo to serve the project. I do have it running locally under http://10.92.20.40:9967/

I would like to deploy this project to heroku but I am not sure how to edit package.json. Would you have any pointers for me? I doubt I should budo in Production.

Thanks, Rima.

caioiglesias commented 8 years ago

Yes, budo is basically for prototyping. It is bundling the assets and index.html just reads the generated bundle.js file

I advise you to take a look at https://devcenter.heroku.com/articles/getting-started-with-nodejs#introduction

And the sample repo https://github.com/heroku/node-js-getting-started

If you peek inside their package.json, you'll notice that their sample app runs node index.js when launched on the server. And inside index.js you'll see that the request handler renders pages/index. That would make you need to understand their templating engine.

Just to get the hang of it, instead of fiddling with templating, deliver the index.html file at once.

rimager commented 8 years ago

That sounds like what I want to do, but I am having a hard time serving index.html on heroku, even locally :(

rimager commented 8 years ago

Oh so I need to use expressJS then. Thank you, I will give that a try!

rimager commented 8 years ago

@caioiglesias Thank you so much Caio. That was the solution!!