Understanding Node.js1 [node.js] EXPRESS, Middleware 간단한 웹 서버 만들기 const express = require('express') const app = express() const port = 3000 app.get('/', (req, res) => { res.send('hello world') }) app.listen (port, () => { console.log (`Example app listening ${port}`) }) [code] 응답으로 'Hello World'를 보내는 Express 서버 코드 라우팅 : 메서드와 url에 따라 분기(Routing)하기 -라우팅(Routing): 메서드와 url(/lower, /upper 등)로 분기점을 만드는 것 클라이언트는 특정한 HTTP 요청 메서드(GET, POST)와 함께 서버의 특정 UR.. 2023. 2. 7. 이전 1 다음