Node + Express시작하기

이원찬·2024년 8월 5일

express

목록 보기
1/3

Download | Node.js

위 사이트 에서 본인 플랫폼에 맞게 LTS(Long Time Surrport)Download 한다.

npm init

위 명령어 입력후 package.json, package-lock.json 을 생성해준다.

npm install express

express 를 설치한다.

아래 index.js 파일을 작성한다.

import express from "express";

const app = express();

app.get("/", (req, res) => {
  res.send("Express Server");
});

app.listen(4000, () => {
  console.log(`Server is running at http://localhost:${port}`);
});

node index.js 로 실행 해보면…

잘 나온다!

profile
소통과 기록이 무기(Weapon)인 개발자

0개의 댓글