Making a server with NodeJS and Express

PussinSocks·2022년 7월 18일
0

CloneCoding

목록 보기
3/20

Importing Express packages

  • In the server.js
import express from "express"

Creating Express application

  • express function
const app = express();
  • What is server(application)?

    Basically, server is a computer(without monitor or keyboard) which is turned on 24/7 and connected to internet to listen requests.

  • What is request?

    Request is a message from a user(or a browser) send to server for interaction.(login, searching, and etc)
    Any interaction a user having with a browser.

  • What is callback?

    Callback is a function which server returns for the request

Setting a localhost with port number

import express from "express"

const app = express();

const callbakcFunction = () => console.log("Server is listening on localhost port 4000");

app.listen(portNumber, callbackFunctionName);
  • This open up and make and run the server to listen
profile
On a journey to be a front-end developer

0개의 댓글