server1 [Node.js] Node.js로 서버 구축하기 간단한 턴제 게임의 서버를 구축해보기 서버 실행 코드 cd [file_path] node server.js server.js const http = require('http'); const url = require('url'); const fs = require('fs'); http.createServer((request, response) => { const path = url.parse(request.url, true).pathname; // url에서 path 추출 if (request.method === 'GET') { // GET 요청이면 if (path === '/about') { // 주소가 /about이면 response.writeHead(200,{'Content-Type':'text/ht.. 2019. 12. 22. 이전 1 다음