/node-project-skeleton

Initial structure with skeleton code to begin a Node.js / Express project.

Primary LanguageJavaScript

The nature of a Node.js application lends itself to many tiny servers running together in a cloud. Consequently, I end up making many little projects.

Whenever I begin a new node project, I begin with a call to express. Not a bad start, but I usually want a little more boiler-plate code to begin. So, this project doesn't do anything itself, it is just the start to all my other projects...

Feel free to use it (you'd probably want to fork it), and change the project to suit your own needs.

Installing

Make sure you have the following engines installed locally:

  • Node
  • NPM ... Node.js' package manager

Next, download the code and run the following to download the dependencies:

npm install

Running

Start up the server, via:

node app.js

Finally, open up a browser and view the results:

http://localhost:3000/

Using

You won't see much at this point, as everything is just a skeleton waiting for the flesh. However, the project does have some initial behavior that you may appreciate... or not.

Caveat: My projects usually only expose JSON objects through a REST interface. I do not have the server spend any cycles rendering HTML files. Instead, my projects serve static HTML files and the client renders the data into the web page using FuzzyToast calls.

What you do get from this project is the following:

  • Express without any HTML rendering engine (I always let the client do this).
  • Jake file that builds the REST API from the router.js file.
  • Jake file that runs Mocha tests from the tests directory.
  • A public directory with an index.html that loads jQuery from Google.