카테고리 없음

간단한 웹 서버 만들기(GET 쿼리 스트링 로그)

n00bh4cker 2019. 12. 26. 10:42

사전 준비

 

npm init

npm install express -save

npm install nodemon -g 

 

const express = require('express')
const app = express()

app.get('/',(req,res)=>{
	for (const key in req.query)
    {
    	console.log(`${key} : ${req.query[key]}`)
    }
    res.send("hello")
})

app.listen(8080,()=>
{
	console.log('Server is Running...')	
})