This is a Next.js project bootstrapped with create-next-app
.
lib/db.js
: dbConnect() connects to the db via the process.env.MONGO_URL
src/app/api/post/route.tsx
: POST to DB.
This is a Next.js project bootstrapped with create-next-app
.
lib/db.js
: dbConnect() connects to the db via the process.env.MONGO_URL
src/app/api/post/route.tsx
: POST to DB.
https://mongodb-nextjs-connection-sample.vercel.app/