Type error: connectToMongo is not a function
My code (Index.js)
const connectToMongo = require('./db') connectToMongo();
My code (db.js)
const mongoose = require('mongoose'); const mongoURI = "mongodb://localhost:27017" const connectToMongo = ()=> { mongoose.connect(mongoURI,()=>{ console.log("Connected to mongo successfully") }) } module.export = connectToMongo;
Can anyone help?
I think this line
should be