UNPKG

create-swiftstart

Version:

Automate the setup of Vite-React & Next.js projects with a pre-designed boilerplate structure using create-swiftstart. This tool saves your time and provides a clean starting point for your React or Next.js applications.

17 lines (14 loc) 316 B
const mongoose = require("mongoose"); const URI = process.env.MONGO_URI; const connectionParams = { useNewUrlParser: true, useUnifiedTopology: true, }; mongoose .connect(URI, connectionParams) .then(() => { console.log("[*] Connected to MongoDB"); }) .catch((err) => { console.error(``); });