Node.js and nodejitsu

I wanted to checkout node.js a little more and after looking at Heroku, nodejitsu seemed a little simpler so I'm going to create an app on nodejitsu.

nodejitsu signup is easy and once I registered and got the email to install:
 sudo npm install jitsu -g
However I got errors.

After checking the nodejitsu notices I gleaned my node version was too old (v.0.6.16) and I needed to upgrade
I saw some posts about n, a tool for managing node versions.
Using n, I switched to node v0.8.8. That kicked off a few minutes of compiles, but thankfully all worked
I ran "npm clear cache" (to be safe) and then reinstalled jitsu
It worked!
I followed the Getting Started instructions. http://www.nodejitsu.com/paas/getting-started.html

I installed their default helloworld and deployed it to: http://dnj.jit.su
Yeah, it worked. Baby steps.

But I want to load an html file, with my (backbone) js code ultimately....
So I modified the nodejitsu hellow world to load an index.html and created said file in same folder
So my server.js is now:
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end(fs.readFileSync(__dirname + '/index.html'));
}).listen(8080);

I fixed a few issues such as content type but got it deployed successfully. You can see my first node app at:
  http://dnj.jit.su/

Update: I have since put the code in a repo on github and changed the site url to be here


Thanks to awesome tune here. Luv it!  Teaching my 5yo son to dance to that tune this weekend...priceless.

Comments

Popular posts from this blog

deep dive into Material UI TextField built by mui

angular js protractor e2e cheatsheet

react-router v6.4+ loaders, actions, forms and more