3 ms·
anyone have experience with node on heroku, with all the jazz (mongo, redis, socket.io)?
by dmmalam 15y ago
anyone have experience with node on heroku, with all the jazz (mongo, redis, socket.io)?
- swalkergibson 15y agoI just set up my first node app on Heroku last week. As far as I can tell, doing anything with sockets is not possible, per their doumentation, however, I have been pleased with the service thus far. Here is the article from Heroku as to how to set it all up: http://devcenter.heroku.com/articles/node-js http://devcenter.heroku.com/articles/node-js You have to use an add-on for Mongo, but it's easy to configure that from the Heroku app dashboard. Overall, I have been pleased thus far. The one gotcha I ran into was that you have to define the port the app will listen on as process.env.PORT as opposed to your own port. Thus, assuming you are using express, the line is: app.listen(process.env.PORT || YOUR LOCAL DEV PORT);
- ThaddeusQuay2 15y agohttp://devcenter.heroku.com/articles/node-js http://devcenter.heroku.com/articles/node-js "-----> Compiled slug size is 3.2MB" It takes 3.2MB to say "Hello World!" on Heroku using Node.js?
- DrJ 15y agoa `Hello World` HTTP Server + Express + Connect that's basically Rails
- aashay 15y agoDon't forget that Heroku's "PORT" is a string while app.listen will expect an int. Easy fix, just parseInt(process.env.PORT).
- aashay 15y agoYes, and it's brilliantly easy. Cedar stack is a pleasure to work with. The best part about using Heroku for NodeJS apps is that I can focus more on writing my app code and less on sysadmin-related tasks. I don't have to worry very much about provisioning or scaling ("heroku scale web=2" tadaaa). The downsides include cost (this depends on a variety of factors of course, e.g. what 3rd party plugins you're using) and lack of "control" (if you care about that sort of thing). Also, they don't support WebSockets (yet). <self-promotion-warning> My Node Knockout app is running nodejs/mongo/redis/socket.io (resorting to long-polling since Heroku doesn't support Websockets, but it's quick enough): http://restalytics.com http://restalytics.com (sorry, the home page is kinda busted, but scroll down to the bottom and log in with nkodemo@restalytics.com/nkodemo if you'd like to see a working demo. Modern browsers only). </self-promotion-warning> Edit: I'm linking to my app to show you an example of a working NodeJS app on Heroku, but I've wrapped it in a self-promotion-warning regardless to preemptively fend off any downvotes that I might get as a result of people misunderstanding my intentions. Edit2: Full disclosure, I happen to work at Salesforce.com.
- ben1mal 15y agoThe lack of WebSocket support is a bit discouraging. We tried out nodester for a while as well but ended up rolling our own. no.de appears to be the new hotness on that front.
- rodh257 15y agoMy iPhone app (http://convoyapp.net http://convoyapp.net) uses NodeJS hosted on Heroku, I looked at various NodeJS hosting options and found Heroku the easiest to get going, not being a Rails guy I've not used them before but I can see what the fuss is about now. It's been running since without a hitch, definitely recommended.