채팅
-
03. ECMA6 로 해보기 ( chatServer (기본채팅) ) [Node.js]NodeJS 2016. 11. 15. 17:20
채팅 서버 ( chatServer ) chatServer.js const http = require('http');const fs = require('fs');const socket = require('socket.io'); const server = http.createServer( (request, response) => { fs.readFile('view/chatClient.html', 'UTF-8', (error, data) => { response.writeHead( 200, {'Content-Type' : 'text/html'} ); response.end(data); });}).listen(8000); // Socket Server 생성 및 시작const io = socket.listen(s..