Code samples for my Intro to Node.js session
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
css
js
.gitignore
Intro to nodejs.key
Intro to nodejs.pdf
README.md
ajax.html
bookList.ejs
bookModel.js
bookModelTest.js
bookRoutes.js
bookRoutes2.js
bookSearch.ejs
bookView.ejs
chat.html
express1.js
express2.js
express3.js
express4.js
helloworld.js
initDB.js
jquery.min.js
misc.txt
nodejslogo.png
package.json
sample.html
slides.html
socketioDemo.js
tcpchatserver.js
tcpechoserver.js
webserver1.js
webserver2.js
webserver3.js

README.md

intro-to-nodejs

Code samples for my Intro to Node.js session

For more information on these examples read my blog post: http://hectorcorrea.com/blog/introduction-to-node-js

Samples

List of code samples in the order in which the are introduced during the presentation.

  • helloworld.js: Server side JavaScript (no web stuff)

  • webserver1.js: A bare bones web server. Hard coded to always return hello world.

  • webserver2.js: A bare bones web server capable of serving one HTML file (sample.html)

  • webserver3.js: A bare bones web server capable of serving any HTML/PNG/CSS/JS file on current folder.

  • echoserver.js: A program capable to accept TCP connections.

  • chatserver.js: A sample chat server over TCP.

  • express1.js: Express.js site to handle static files.

  • express2.js: Express.js site to handle routes and HTTP verbs.

  • express3.js: Express.js site to handle views.

  • express4.js: Express.js site using a MongoDB database. References bookRoutes.js and bookModel.js