server.js const http = require('http'); const fs = require('fs').promises; const path = require('path'); const users = {}; // 데이터 저장용 http .createServer(async (req, res) => { try { if (req.method === 'GET') { // GET 방식인경우 if (req.url === '/') { //url 이 '/'인 경우 const data = await fs.readFile(path.join(__dirname, 'restFront.html')); // ./restFont.html 파일 읽기 res.writeHead(200, {'Content-Type': 'text/html; charset=utf-8'}); return res.end(data); // 읽은 restFont.html return하기 } else if (req.url === '/...
#
DELETE
#
node
#
POST
#
PUT
#
RESTFULapi
원문 링크 : REST API(POST,PUT,DELETE)