start implementing a proxy layer for the API of creativecommons.tankerkoenig.de

This commit is contained in:
Joachim Lusiardi 2017-10-30 06:49:56 +01:00
parent af6f271b29
commit 47e81c7517
2 changed files with 19 additions and 1 deletions

View File

@ -1,4 +1,4 @@
from flask import url_for, redirect, render_template
from flask import url_for, redirect, render_template, request
from flask_security import login_required
from flask_security.core import current_user
from sqlalchemy.exc import IntegrityError
@ -129,3 +129,20 @@ def delete_account():
return render_template('deleteAccountForm.html', form=form)
@app.route('/filling_stations', methods=['GET'])
#@login_required
def query_filling_stations():
api_key = app.config['TANKERKOENIG_API_KEY']
lat = request.args.get('latitude')
lon = request.args.get('longitude')
rad = request.args.get('radius', default=10)
type = request.args.get('type', default='all')
sort = request.args.get('sort', default='price')
return lat
@app.route('/filling_stations/<fsid>', methods=['GET'])
#@login_required
def query_filling_station_details(fsid):
api_key = app.config['TANKERKOENIG_API_KEY']
return fsid

View File

@ -18,6 +18,7 @@ class Config:
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
ADMIN_MAIL = 'joachim@lusiardi.de'
TANKERKOENIG_API_KEY = os.environ.get('TANKERKOENIG_API_KEY')
@staticmethod
def init_app(app):