Created
April 23, 2011 01:48
-
-
Save csanz/938136 to your computer and use it in GitHub Desktop.
Getting started with node.js as Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var c = require('commitment'); | |
| /* | |
| Ok, before you start this, be committed to following | |
| each step NON-STOP until you are done with all the instructions! | |
| I'm assuming you are a mac os x user. | |
| If you are using windows, sorry about that... | |
| Install | |
| - node.js https://github.com/joyent/node | |
| - npm https://github.com/isaacs/npm | |
| - Install n https://github.com/visionmedia/n | |
| - Install mongodb http://www.mongodb.org/display/DOCS/Quickstart | |
| Bookmark Github Influencers | |
| - https://github.com/visionmedia (expressjs, | |
| mongoose, connect, jade, etc - sinatraish-like framework) | |
| - https://github.com/learnboost (everything!) | |
| - https://github.com/guille (socket.io, mongoose, etc) | |
| - https://github.com/csanz ME hahahaha I'm not at | |
| the level of these guys, so feel free to 'not' follow ;( | |
| Learn how to debug your shit | |
| http://nodejs.org/docs/v0.4.6/api/debugger.html | |
| > a quick website | |
| create server.js | |
| hit node debug server.js | |
| got to http://127.0.0.1:8124/ | |
| see the debug in action! hit help for details. | |
| you can also run 'print test' ;) | |
| */ | |
| var http = require('http'); | |
| http.createServer(function (req, res) { | |
| res.writeHead(200, {'Content-Type': 'text/plain'}); | |
| res.end('Hello World\n'); | |
| var test = "ohh yeah, you are awesome"; | |
| debugger; | |
| }).listen(8124, "127.0.0.1"); | |
| console.log('Server running at http://127.0.0.1:8124/'); | |
| /* | |
| > a quick cli | |
| create cli.js | |
| hit node debug | |
| type 'print test' ;) | |
| */ | |
| var sys = require('sys'); | |
| var test = "ohh yeah, u r still awesome"; | |
| debugger; | |
| sys.puts('hello awesome dude'); | |
| /* | |
| Ok, now before you go back to your TV, console game, | |
| or twitter/facebook account, build a quick APP! | |
| Here are the requirements: | |
| - website that uses expressjs, jade and mongoose | |
| - have home page, registration page and login page | |
| - make it actually work! | |
| - You can cheat and use this example: | |
| https://github.com/visionmedia/finance | |
| Now learn your mongodb, you have to get | |
| good at using the shell as well. | |
| - http://www.mongodb.org/display/DOCS/Tutorial | |
| Ok, now go watch TV, take a quick break... | |
| come back and check out my buddy's awesome book: | |
| - http://ofps.oreilly.com/titles/9781449398583/ | |
| Go give him props ok http://twitter.com/#!/sh1mmer | |
| You may be wondering WTF? why didn't I share this first? | |
| well, because it is too much reading... to learn node it | |
| doesn't require that much reading, | |
| but you do need to know the details. | |
| Awesome website written using Node.js | |
| - Learnboost.com | |
| - Storify.com | |
| - Geekli.st (Coming soon http://bit.ly/goPevc) | |
| This gist was inspired by the following article: | |
| http://marcorogers.com/blog/01-22-2011/nodejs-community-could-use-some-tlc | |
| Also, I'm working on a generator to make it easier | |
| for devs to build new apps using node, the | |
| name is ngen https://github.com/csanz/ngen if | |
| you have examples/ideas/feedback please send | |
| them my way at chris@geekli.st (follow me for updates) | |
| and last, check out http://nodejs.org/docs/v0.4.6/api/ | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment