Thursday, December 15, 2016

Generate project expressjs


Overview: Expressjs is one of the most popular web framework which is build on top of nodejs. It is a minimal framework for creating server side or restful APIs (application programming interfaces).

Objective: Create project expressjs using express-generator

Quick Start:
First of all, you need to install express-generator

npm install -g express-generator

After installed let create the app by using key word express:

express --view<engine> project-name

Noteview <engine> support (ejs|hbs|hjs|jade|pug|twig|vash) (defaults to jade)

Install dependencies and running project by default app run at http://localhost:3000

npm install
npm start


Here are Command Line Options

-h, --help          output usage information
    --version       output the version number
-e, --ejs           add ejs engine support
    --hbs           add handlebars engine support
    --pug           add pug engine support
-H, --hogan         add hogan.js engine support
-v, --view          add view  support (ejs|hbs|hjs|jade|pug|twig|vash) 
      (defaults to jade)
-c, --css           add stylesheet  support (less|stylus|compass|sass) 
      (defaults to plain css)
    --git           add .gitignore
-f, --force         force on non-empty directory

No comments:

Post a Comment