syntaxhighlighter

Sunday, August 26, 2012

Setup - express-examples/sqlite

Following the steps I performed for creating the project, after being installed node.js and npm (see [How to run it](wiki/How to run it) for details on how to install them):

Installing express

I wanted to install express globally, for doing that:

$ sudo npm install -g express

Notes:

  • If you want to install an specific version (in my case I have 3.0.0beta7) you can use name@version, e.g. $ sudo npm install -g express@3.0.0beta7
  • If you don't want a global version of express, you can remove -g option. Packages "not global" are installed into node_modules folder.

Creating the application skeleton

The application skeleton was created with express, specifying 2 "not standard" options:

  • EJS. As view engine. I prefer it a lot compared with Jade, which is the default for express, because I'm more familiar with HTML, and really don't think jade's way to implement web pages is realistic and maintainable.
  • Session. Just enabled the use of sessions within express' application.

Following the command used:

$ express --sessions --ejs

No comments:

Post a Comment