morgan 사용시 아래와 같이 요청을 보냈을 때, 어떻게 응답했는지 알 수 있다. 즉 요청과 응답을 기록하는 라이브러리이다.
app.use(morgan('combined'));

morgan의 인자를 dev로 두면 위와 같이 나오고 combined로 두면 조금 더 자세히 나온다.
요청 헤더의 쿠키를 해석해주는 미들웨어
실제 쿠키 옵션들을 넣을 수 있음
app.use(cookieParser())
app.get('/', (req, res, next) => {
res.cookie('name', encodeURIComponent(name), {
expires: new Date(),
httpOnly: true,
path: '/'
})
res.clearCookie('name', encodeURIComponent(name), {
httpOnly: true,
path: '/'
})
res.send('hello express11');
})
위 처럼 쿠키를 손 쉽게 셋팅이 가능하다.

app.use(cookieParser('mumunodejs'))
app.get('/', (req, res, next) => {
req.signedCookies;
res.send('hello express11');
})
cookieParser의 인자에 암호화 하고 싶은 것을 넣는다면 req.signedCookies로 가능하다
요청의 본문을 해석해주는 미들웨어
app.use(express.json())
app.use(express.urlencoded({ extended: true })) // form data를 파싱해주는 것
req.body.변수
위 처럼 쉽게 body의 내용을 빼 올수 있다.
bodyParser에는 raw, text등이 있는데 현재는 잘 쓰지 않는다