Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mongodb-developer/mongodb-express-rest-api-example

Example for the article on MongoDB and Express JS web REST API tutorial
https://github.com/mongodb-developer/mongodb-express-rest-api-example

expressjs mongodb mongodb-driver node-js rest-api

Last synced: 5 days ago
JSON representation

Example for the article on MongoDB and Express JS web REST API tutorial

Awesome Lists containing this project

README

        

# MongoDB and Express.js REST API sample application

This repository contains the sample application for the [MongoDB and Express.js REST API tutorial](https://www.mongodb.com/languages/express-mongodb-rest-api-tutorial).

## How To Run

1. You can follow the [Getting Started with Atlas](https://docs.atlas.mongodb.com/getting-started/) guide, to learn how to create a free Atlas account, create your first cluster and get your Connection String to the database.
Then, set the Atlas URI connection parameter in `server/.env` to your Connection String:
```
ATLAS_URI=mongodb+srv://:@sandbox.jadwj.mongodb.net/myFirstDatabase?retryWrites=true&w=majority
```

2. Start the Express server:
```
cd server
npm install
npm run dev
```

3. Start the React app (in a new terminal window):
```
cd app
npm install
npm start
```

## Disclaimer

Use at your own risk; not a supported MongoDB product