skip to Main Content

Mongodb – new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))

I have tried to run this code: const connectToMongo = require('./db') const express = require('express') connectToMongo(); const app = express() const port = 3000 // Available Routes app.use('/api/auth', require('./routes/auth')) app.use('/api/notes', require('./routes/notes')) app.listen(port, () => { console.log(`Example app listening on port…

VIEW QUESTION
Back To Top
Search