Skip to content
Snippets Groups Projects

Create endpoint for user-registration

Compare and Show latest version
2 files
+ 28
2
Compare changes
  • Side-by-side
  • Inline
Files
2
import mongoose from "mongoose";
import { MongoMemoryServer } from "mongodb-memory-server";
async function connect(){
const mongod = await MongoMemoryServer.create();
const getUri = mongod.getUri();
mongoose.set('strictQuery', true)
const db = await mongoose.connect(getUri);
console.log("Database Connected")
return db;
}
export default connect;
\ No newline at end of file
Loading