Skip to content

andresgariglio/poc-flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

poc-flask

POC Rest API using Flask that allows you to create, update and retrieve Person objects stored in a MongoDB NoSQL database.

Configuration

Default MongoDB config in flask_rest_service/_init_.py file:

MONGO_URL = "mongodb://localhost:27017/poc";

How to run

Install packages/dependencies:

pip install -r requirements.txt

Running "runserver.py" file you should be able to visit the rest service at http://localhost:5000 and get an "OK" status.

python runserver.py 

Rest API examples

GET

curl http://localhost:5000/persons
curl http://localhost:5000/persons/{ID}

POST

curl -i -X POST -H "Content-Type:application/json" -d '{  "firstName" : "Marty",  "lastName" : "McFly" }' http://localhost:5000/persons

PUT

curl -X PUT -H "Content-Type:application/json" -d '{ "firstName": "Emmett", "lastName": "Brown" }' http://localhost:5000/persons/{ID}

DELETE

curl -X DELETE http://localhost:5000/persons/{ID}

About

POC Rest API using Flask [Python]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages