paint-brush
How to Build Your First NodeJS Server with ExpressJSby@Mulhern
378 reads
378 reads

How to Build Your First NodeJS Server with ExpressJS

by Brendan
Brendan HackerNoon profile picture

Brendan

@Mulhern

Javascript Enthusiast - Find Angular Book Here: https://www.lulu.com/account/projects/7dqz7r.

July 26th, 2020
Read on Terminal Reader
Read this story in a terminal
Print this story
Read this story w/o Javascript
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Initialize the project: Create the home script, install the necessary dependencies, create the server and write the server file. Create the server for the first time: Write the server. Use the project's home script to create a home page and create a server. Create a server: Write a server file: Create a home script and write a server. Use the server to create the home and server. For more information about the project, visit http://://://www.com/pieriercognognogna.org/svsvsv.
featured image - How to Build Your First NodeJS Server with ExpressJS
Brendan HackerNoon profile picture
Brendan

Brendan

@Mulhern

Javascript Enthusiast - Find Angular Book Here: https://www.lulu.com/account/projects/7dqz7r.

About @Mulhern
LEARN MORE ABOUT @MULHERN'S
EXPERTISE AND PLACE ON THE INTERNET.

Initialize the project:

npm init

Install the necessary dependencies:

npm install express http --save

Create the home script:

touch index.js

Install nodemon:

npm install nodemon -g

Write the server file:

let express = require('express')
let http = require('http')

// Initializes an express app.
let app = express()

// Gets the first route: '/'.
app.get('/', function(req, res) {
// Sends "HELLO WORLD"
    res.send("HELLO WORLD")
})

// Creates a new http server with app and listens on localhost:8080 in your browser.
http.createServer(app).listen('8080')


L O A D I N G
. . . comments & more!

About Author

Brendan HackerNoon profile picture
Brendan@Mulhern
Javascript Enthusiast - Find Angular Book Here: https://www.lulu.com/account/projects/7dqz7r.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Pipfeed
Startupnchill
Coinerblog
X REMOVE AD