[ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
서버가 클라이언트로 복수의 응답을 보내려고 할때 발생하는 에러라고한다.
ㅇㅋ...
if(condition){
res.status(400).json({
ok:false,
error:"some fucking error"
})
}
res.status.(200).json({
ok:true
})
if(condition){
return res.status(400).json({
ok:false,
error:"error that some fucking reason"
})
}
return res.status.(200).json({
ok:true
})
return을 의미론적으로라도 잘 사용하는 습관을 들여야지..