Skip to content

hassanazam/flask-restful-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker container for simple Flask restful API

Make sure you have docker and docker-compose installed.

Flask Restful API

A simple Flask Restful API using Flask-restful

Description

  • A simple Flask Restful API with following endpoints:

    • /add : POST method
    • /subtract : POST method
    • /multiply : POST method
    • /division : POST method
  • Posted data format

{
    "x": 12,
    "y": 20
}
  • Response format
{
    "Message": <answer>,
    "Status Code": 200
}

How to run

  • Clone the repo
  • $ cd flask-restful-docker
  • $ docker-compose build
  • $ docker-compose up
  • Open new terminal/cmd
  • Find you docker machine IP by typing
  • $ docker-machine ip
  • Open your browser and type : http://your-docker-machine-ip:5000/
  • if helloworld appears then its working fine
  • Test API using POSTMAN

MHA

About

Docker container for simple Flask Restful API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published