How to deploy clementine boilerplate to heroku using Mac?

I’ve spent a few hours figuring out how to use mac’s terminal and sublime text to implement clementine onto github application, via heroku’s online link, I used mongolab as the database. (using MONGODB_URI and use heroku config:set to set it and so on) However my heroku app just doesnt run.

Any idea where is how the procedure will be different from the course?

Also, what if I decide not to use clementine as a template to build the dynamic basejump projects? Will it be much harder?

What do the Heroku logs say?

ClementineJS is just a collection of tools and settings that can get you up and running quickly. If you don’t want to use it (I never have), you’ll have to do some research into which tools you want to use instead. You’ll probably end up using all the same stuff, though. Having to connect everything up will take extra time, but won’t necessarily be harder to do. Either way, it won’t affect your deployment problems. Heroku can be a bear sometimes.

I see, thank you so much for the reply. Then I guess using the boilerplate should be more advantageous as I can save efforts in sourcing for appropriate middlewares, also I can learn more by examining how the boilerplate code organize itself:grin:

Below is the latest heroku logs

2017-07-07T20:47:08.161021+00:00 heroku[web.1]: State changed from crashed to starting
2017-07-07T20:47:09.413260+00:00 heroku[web.1]: Starting process with command npm start
2017-07-07T20:47:10.489840+00:00 app[web.1]:
2017-07-07T20:47:10.489855+00:00 app[web.1]: > vote@1.0.2 start /app
2017-07-07T20:47:10.489856+00:00 app[web.1]: > node server
2017-07-07T20:47:10.489857+00:00 app[web.1]:
2017-07-07T20:47:10.995973+00:00 app[web.1]: Successfully connected to MongoDB on port 27017.
2017-07-07T20:47:11.008823+00:00 app[web.1]: Node.js listening on port 3000…
2017-07-07T20:48:09.588969+00:00 heroku[web.1]: State changed from starting to crashed
2017-07-07T20:48:09.535444+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2017-07-07T20:48:09.535514+00:00 heroku[web.1]: Stopping process with SIGKILL
2017-07-07T20:48:09.578924+00:00 heroku[web.1]: Process exited with status 137

Hm. It’s complaining about not being able to bind to the port. Can you share your code?

Alright here is the repo

It’s the clementine boilderplate which I only changed a tiny bit attempting to deploy it to heroku. I’m calling it voteingapp because later on I will build that project base on it.

In your server.js file, app.listen is using a hard coded port value. Change it to use the environment variable:

const port = process.env.PORT;
app.listen(port, function () {
      console.log(`Node.js listening on port ${port}...`);

If you don’t copypaste that, note that the string is surrounded by backticks, which you can find just above the tab key on most English keyboards.

Ah, I see I see. Thank you so much
Should’ve discovered about the app.listen() method. And thanks for clarifying that those are backticks, otherwise I wouldn’t have noticed them haha