에러:
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;
참고:
'TIL > Node.js' 카테고리의 다른 글
TypeError: Cannot read property 'forEach' of undefined (0) | 2020.03.10 |
---|---|
throw new TypeError('JwtStrategy requires a secret or key'); (0) | 2020.03.08 |
Nodejs 에러 | cannot read property 'expires' of undefined (0) | 2019.12.31 |
Nodejs 에러 | ERR_INVALID_CHAR (1) | 2019.12.31 |
Nodejs | 비동기, 콜백, Promise (0) | 2019.12.11 |
댓글