Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 647 Bytes

readme.md

File metadata and controls

42 lines (29 loc) · 647 Bytes

Flask with Mongo and Docker

Setup

docker-compose up -d

docker ps
docker exec -it mongodb bash

mongo -u mongodbuser -p
show dbs;
db.createUser({user: 'flaskuser', pwd: 'your password', roles: [{role: 'readWrite', db: 'flaskdb'}]})
exit
mongo -u flaskuser -p your password --authenticationDatabase flaskdb
exit

Running the Flask To-do App

curl -i http://your_server_ip


curl -i\
    -H "Content-Type: application/json" \
    -X POST -d '{"todo": "Dockerize Flask application with MongoDB backend"}'\
    http://your_server_ip/todo


# list all
curl -i http://your_server_ip/todo