How to create and start a node express project

Node Js

Posted on 15 Jun 17 by Vickey
  206



Express is a most popular framework of node js. With Express we can create apis and web applications with different - different databases like mangodb, MySQL, PostgreSQL, Oracle . In this blog we will create a new express project step by step.

1. First of all need to install node js if installed

2. After node installation we will install EXPRESS GENERATOR. This is a platform for create a skeleton for express sites. For install Express Generator type the below command in your command prompt

npm install -g express-generator

3. Now we will create a express project. In your terminal locate to the directory where you want to create a project skeleton and type the below command. where nodetest1 is the name of your project you can chage it.

express nodetest1

when you have done you can see a new project directory at that location and this is your express project.

nodetest1/
├── bin/
 |
├── node_modules
 |
├── routes
 |
├── views
 |
├── app.js
 |
├── package.json
 |
└── public/
    

Now in terminal locate to in this directory and install npm by using command

cd nodetest1
npm install

it will install DEPENDENCIES for this projects. After complete successfull installation we will start our web server by using command

npm start

Now open your browser and open url http://localhost:3000/. Now you are running your first express projects


If this post help you reduce time to develop, you can help me to maintain this website :)
www.000webhost.com