Skip to content

tkav/example-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Example

Example REST API using Python (Flask), MongoDB and Docker. Includes Postman tests and GitHub Action workflow.

Click here to read my blog on Creating an API using Flask, MongoDB and Docker

Blog Post

Diagram

API Example

Usage

To build and start the API, run:

make start

Go to http://localhost:5000. You should see a "Hello, World!" message.

Endpoints

The API has the following endpoints available:

Endpoint Method Description
/ GET Hello World
/items GET Get All Items
/items/{id} GET Get Item
/items POST Create Item
/items/{id} PUT Update Item
/items/{id} DELETE Delete Item

Data is created, read, updated and deleted from the MongoDB database.

Tests

Postman tests are included for the API endpoints in tests/Example_API.postman_collection.json and are run via GitHub Actions.

Postman tests

Tests can be run locally using:

make tests

About

Example REST API using Python (Flask), MongoDB and Docker

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published