https://github.com/mongodb-developer/netlify-mongodb-starter
A starter for MongoDB on the Netlify platform
https://github.com/mongodb-developer/netlify-mongodb-starter
Last synced: 3 months ago
JSON representation
A starter for MongoDB on the Netlify platform
- Host: GitHub
- URL: https://github.com/mongodb-developer/netlify-mongodb-starter
- Owner: mongodb-developer
- License: apache-2.0
- Created: 2024-02-13T07:28:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-12T07:04:34.000Z (about 1 year ago)
- Last Synced: 2025-03-22T13:51:25.784Z (3 months ago)
- Language: JavaScript
- Size: 406 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Netlify and MongoDB Starter template
This is a template for integrating MongoDB Atlas with a Netlify site using serverless functions.

[](https://app.netlify.com/start/deploy?repository=https://github.com/mongodb-developer/netlify-mongodb-starter)
[](https://github.com/mongodb-developer/netlify-mongodb-starter/actions/workflows/main.yml)
## Setup
1. Clone this repository.
2. Install dependencies with `npm install`.
3. 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:
```
MONGODB_URI = ""
MONGODB_DATABASE = "tasks_netlify"
MONGODB_COLLECTION = "tasks"
```
5. Configure your environment variables in `netlify.toml`.
6. Run `netlify dev` to start your local server.## Deploying to Netlify
### Set website secrets from .env.local
```
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.