Skip to content

Instantly share code, notes, and snippets.

@samirsaci
Last active March 13, 2021 20:08
Show Gist options
  • Save samirsaci/fdc920a158ea9dd173234e8e4e2c869b to your computer and use it in GitHub Desktop.
Save samirsaci/fdc920a158ea9dd173234e8e4e2c869b to your computer and use it in GitHub Desktop.
Flask API Google Maps
from flask import Flask, render_template, request, redirect
app = Flask(__name__)
# Home Page
@app.route('/')
def index():
return render_template('index.html')
# Distance Page
@app.route('/distance/<fr>/<to>', methods=['GET', 'POST'])
def distance(fr, to):
#selenium bot function returns result
result = from_to(fr, to)
return result
if __name__ == '__main__':
# Threaded option to enable multiple instances for multiple user access support
app.run(debug=True, port=5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment