Skip to content

Cristiano-Rocha/simple-flask-api

Repository files navigation

A simple Flask API

This a simple api built with Flask microframework

Tecnologies used

  • Pyhon3 Python is a programminglanguage that lets you work quickllu and integrate more effectively

  • Flask Flask is a microframework written in Python

  • Poetry Python Packaging and dependency management

  • Flask SQLAlchemy Flask-SQLAlchemy is an extension for Flask that adds support for SQLAlchemy to your application

  • Flask Migrate Flask-Migrate is an extension that handles SQLAlchemy database migrations for Flask applications using Alembic

  • Docker Docker takes away repetitive, mundane configuration tasks and is used throughout the development lifecycle for fast, easy and portable application development

  • Docker Compose Compose is a tool for defining and running multi-container Docker applications

🌱 How to start this project

Endpoints

GET /api/dog
POST /api/dog
DELETE /api/dog
PUT /api/dog

GET /api/dog

Will return all dogs record from database

{
    "results": [
        {
            "name": "Pluto",
            "age": 10,
            "color": "brown",
            "gender": "male",
            "breed": "Bloodhound",
            "size": "large"

        },
        {...}
    ]
}

POST /api/dog

Add a new dog to the database

{
    "name": "Pluto",
    "age": 10,
    "color": "brown",
    "gender": "male",
    "breed": "Bloodhound",
    "size": "large"
}

DELETE /api/dog/<int:id>

Delete an existing record with the specific id

PUT /api/dog/<int:id>

Update an existing record with the specific id

{
    "name": "Pluto",
    "age": 11,
    "color": "brown",
    "gender": "male",
    "breed": "Bloodhound",
    "size": "large"
}

How to run

Build the image:

docker build -t simple-flask-api:lastest -f simple-flask-api/Dockerfile simple-flask-api

Run the container with following command:

docker run -p 5000:5000 simple-flask-api:latest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published