Setup new project

Youngjin Son·2023년 1월 19일
0

APIs

목록 보기
4/4

1. CD to where you want to create your new porject.

$ cd {경로}

2. Create New Project Folder.

$ mkdir {폴더명}

3. Inside the folder, create new js files, html files.

$ touch {파일명}

4. Initialise npm.

$ npm init

5. Install body-parser, express and request npm modules to the new project.

$ npm install body-parser express request

6. Require the newly installed modules inside js file.

const bodyParser = require('body-parser');
const express = require('express');
const request = require('request');

7. Create a new express app and set it to listen on port 3000.

const app = express();
const port = 3000;

8. Once port is set up, log "server is running on port 3000".

app.listen(port, () => {
  console.log("server is running on port " + port);
}

참고
express
body-parser
request

profile
아자아자

0개의 댓글