This is a template for integrating MongoDB Atlas with a Netlify site using serverless functions.
- Clone this repository.
- Install dependencies with
npm install
. - Set up your MongoDB Atlas database and get your URI. (Verify IP access is appropriate for your website IP)
- You will need to setup the needed envioronment variables in
.env.local
or your site secrets:
- You will need to setup the needed envioronment variables in
MONGODB_URI = "<YOUR MONGODB | MONGODB ATLAS URI>"
MONGODB_DATABASE = "tasks_netlify"
MONGODB_COLLECTION = "tasks"
- Configure your environment variables in
netlify.toml
. - Run
netlify dev
to start your local server.
netlify env:import .env.local
Or use the Netlify ui ince web site is available and redeploy.
Click the deploy button above and connect to your website.
-OR-
Push this repository to your GitHub and link it to a new Netlify site. Set up environment variables in the Netlify UI.