This is a RESTful web application for cities, implemented using Flask, Python 3.6, MongoDB, PyMongo, virtualenv, pip, postman and remote mLab server for MongoDB database.
python3.6 ./restPyMongo.py inside flaskvirtualenvironment
In postman type 0.0.0.0:9999/ ----> @app.route('/') def about_cities():
In postman type 0.0.0.0:9999/cities ----> @app.route('/cities', methods=['GET']) def get_all_cities()
In postman type 0.0.0.0:9999/cities/<city_name> ----> @app.route('/cities/string:name', methods=['GET']) def get_city(name)
In postman type 0.0.0.0:9999/cities ----> @app.route('/cities', methods=['POST']) def add_city()
In postman type 0.0.0.0:9999/cities/<city_name> ----> @app.route('/cities/string:name', methods=['PUT']) def update_city(name)
In postman type 0.0.0.0:9999/cities/<city_name> ----> HTTP DELETE request for deleting/removing a particular city @app.route('/cities/string:name', methods=['DELETE']) def delete_city(name)