TIL/Node.js
TIL D-09 throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
홍차23
2020. 1. 14. 17:25
에러:
throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
^
TypeError: Router.use() requires a middleware function but got a Object
해결방법:
//api.js 파일에 아래 코드 추가
module.exports = router;
참고: