Nodejs Express application generator

Using the express generator tool we can quickly and easy create an application skeleton.

Install express generater

npm install express-generator -g

1installing-express-1generator

Use express -h for help

express -h

  Usage: express [options] [dir]

  Options:

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

Creating Express application with express generator

syntax

express <options> <application_name>

eg

express myapp

2-express-generater-my-app-1

It will create the folder structure and some required files

3-express-generater-my-appfolderstruct

Go inside your app folder and  execute npm install

after-executing-npm-install

It is ready to start the server

runninf-the-server

 

 

ref : https://expressjs.com/en/starter/generator.html

 

Author: bm on October 5, 2016
Category: NodeJs
Tags: , ,