
Enter the host name and port number, as per your choice. l = processdata() # Forward the data to the source that called this API. def displaylocations(): # Obtain the CSV data. app = Flask(_name_) CORS(app) # In this case, the URL route is 'displaylocations'. Here, jsonify is used to convert the list datatype to JSON, because JavaScript cannot read data of type list. Create a variable and a URL route for your Flask application.

Import utility functions, which in this case is the program for converting the CSV into a more suitable format. An application can be deployed in five simple steps:įrom flask_cors import CORS from flask import Flask, jsonifyĢ.


Let the code for the flask application be in app.py. In our case, i.e., integrating Google Maps API into an application, Flask is exactly what we need since it provides a very strong and secure base for experimentation and exploration. Flask is a web micro-framework written in Python, that can be used to create APIs and host applications locally and externally, even though the latter is not a secure option.
