Skip to content

Instantly share code, notes, and snippets.

@darahayes
Last active January 26, 2016 11:55
Show Gist options
  • Save darahayes/e64dc12b0d26dd473e6c to your computer and use it in GitHub Desktop.
Save darahayes/e64dc12b0d26dd473e6c to your computer and use it in GitHub Desktop.
Getting started with node

#Getting Started With Node

So... Enterprise development is a little crazy. I think he managed to give us a bare idea of what we're meant to do but he left out some really important things. So this is a post for people who might not be familiar with Node.js etc.

Firstly, it can be a bit of a pain to install properly. Luckily there's a great project called nvm (node version manager) that can make the installation and management of node versions on *nix really easy. nvm can be installed in a single line. Follow the instructions to install in the link.

Once installed you can install node and npm with the following

nvm install 4.2.3 #install node
nvm use 4.2.3 #tell nvm to place the installation in the right directories
nvm alias default 4.2.3 #ensures node is always on the path when logging in
node --version #verify node is installed

#Good Intro Tutorials For those really unfamiliar with javascript, the best way to learn is with some practical examples. nodeschool is a great website that has some really good interactive workshops.

The workshops are installed locally using npm.

###Javascript The best place to start for anyone who hasn't done javascript is the 'javascripting tutorial'

npm install -g javascripting #install the module globally
javascripting #runs the tutorial

###Nodejs A goood intro to node is learnyounode. This actually gets quite challenging. Some of the concepts might never come up while doing the assignment.

npm install -g learnyounode
learnyounode

###Server Frameworks When it comes to actually building a RESTful HTTP server Express and Hapi are the two most popular server frameworks. Express is the most popular at the moment (although I've begun to like Hapi more).

Once again learnyounode has workshops for both of these frameworks

npm install -g expressworks
npm install -g makemehapi

###Additional Well, you might have seen the email with "starter code" today... I cannot comment on the angular stuff because I don't know much angular but frankly, the Express server code is cough really bad. It might be okay to get some ideas but it's messy and all over the place.

###Starter code... I've been using Hapi.js in my FYP and I'm at a stage where I'll be able to port a lot of the code into a separate starter or seed project which you folks could possibly use. ETA maybe a week from now. It's just a backend api (no front end stuff) but it's better than nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment