Node.js 간이 서버

2757 단어 Node.js기초
var http = require('http')

var server = http.createServer(function(req, res){
  res.writeHead(200, {'Content-Type': 'text/plain'})
  res.write('Hello Node
'
) res.end() }) server.listen(8888, '127.0.0.1') console.log('Server is running at http://127.0.0.1:8888/')
var http = require('http')

http.createServer(function(req, res){
  res.writeHead(200, {'Content-Type': 'text/plain'})
  res.write('Hello Node
'
) res.end() }).listen(8888, '127.0.0.1') console.log('Server is running at http://127.0.0.1:8888/')
var http = require('http')

http.createServer(function(req, res){
  res.writeHead(200, {'Content-Type': 'text/plain'})
  res.end('Hello Node
'
) }).listen(8888, '127.0.0.1') console.log('Server is running at http://127.0.0.1:8888/')

좋은 웹페이지 즐겨찾기