Posts

Showing posts from June 13, 2018

Create First NODE JS application

Image
Before creating the NODE JS application, please ensure that you have successfully install NODE JS server on your PC.

To download and setup the NODE JS, follow https://nodejs.org/en/download/
After setup node js, check it is installed successfully using below steps. 1)Open command prompt.
2)Run node –v command
3)It should show current version of node js


Create your first project using below steps: 1)Open command prompt.
2)Create a new folder named “NodeJSApp”. Use md NodeJSApp command.
3)Run cd NodeJSApp.
4)    Run npm init command and follow instruction as below. Ensure you give app.js as a starting script file. This will create package.json file

5)Open this project in “Visual Studio Code” IDE.
6)  Create new file “app.js” inside the NODEJSAPP folder

7)Write below code inside the app.js

const express = require('express') const app = express()              const port = process.env.PORT || 4000
             app.listen(port, () => {
                  console.log(`Server started on port ${port}…

Recent Post

Recent Posts Widget