Up and Running with Meteor and Heroku
I stumbled across meteor in the weeks during my leave after the birth of my daughter. I’ve used php and python to build apps for work and play in the past, but reading hackernews re-piqued my interest in the node.js codesphere. Here are the details of getting up and running with meteor and heroku.
meteor
Meteor is a js framework featuring tight integration between client and server. I installed meteor according to the docs and tried out the examples. After that was done, I moved on to building my own app locally.
When it came time to deploy, there were a few options:
- use
meteor deploy
to push to a subdomain of meteor.com - use
meteor bundle
to deploy on my own node.js setup somewheres
I chose the second, electing to use a free heroku account to host the app. I ended up not bundling the app locally, opting instead for a buildpack. More on that in a second.
To harden the app before public deployment, I disabled client db updates:
heroku
I signed-up for a free heroku account to get started.
After trying and failing to perform the steps manually, I stumbled across this buildpack that automates most of the process.
With the buildpack, you can deploy straight from your meteor code (you don’t have to bundle first):
Create the heroku app with the buildpack:
And now you can just commit/push whenever you want to deploy:
Sidenotes
heroku ssh keys
After my initial login to heroku, I changed my ssh keys to setup my github account. You can update your ssh keys with heroku with the following:
heroku app name
If you don’t specify the app-name at creation, heroku assigns a randomized name for you. You can change the name via cmd line:
If you change the app name via the heroku dashboard, you’ll need to update the git remote config:
References:
- http://bytesofpi.com/post/20898722298/pushing-your-meteor-project-to-heroku
- https://github.com/jordansissel/heroku-buildpack-meteor
- http://stackoverflow.com/questions/10115042/how-do-you-secure-the-client-side-mongodb-api