
routes 파일에서 아래의 문장이 빠진 경우 위와 같은 에러가 출력됩니다.
module.exports = router;
코드 맨 아래줄에 이 문장을 추가해주면 해결이 됩니다.
참고
https://tristan91.tistory.com/529
TypeError: Router.use() requires a middleware function but got a Object
routes폴더의 파일 마지막에 const express = require('express'); const router = express.Router(); router.post('/', async (req, res, next) => { try { console.log(req); res.json(req); } catch (err) { co..
tristan91.tistory.com