https://github.com/caresle-archive/flask-mongo
An api using flask + mongo
https://github.com/caresle-archive/flask-mongo
flask mongodb python
Last synced: 3 months ago
JSON representation
An api using flask + mongo
- Host: GitHub
- URL: https://github.com/caresle-archive/flask-mongo
- Owner: Caresle-Archive
- Created: 2021-10-26T18:14:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-26T20:55:16.000Z (over 4 years ago)
- Last Synced: 2025-01-17T04:35:03.952Z (over 1 year ago)
- Topics: flask, mongodb, python
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flask Mongo
A flask + mongodb api.
## How to run
- The project suppose to use a local version of mongodb
1. Create a virtual env
```bash
# Windows
python -m venv venv
```
2. Activate the virtual env
```
# Windows
venv\Scripts\activate
```
3. Install flask
```
pip install Flask
```
4. Run mongodb in another terminal
```
mongod
```
5. Execute flask
```
flask run
```
## Endpoints
GET `/games`
Show the list of all the games
POST `/games`
Create a new game like the example below
```json
{
"name": "game name"
}
```
PUT `/games/:id`
Update the name of the game. Example below:
```json
{
"name": "New game name"
}
```
DELETE `/games/:id`
Delete the given element