diff --git a/.gitignore b/.gitignore index 225083f..812d75d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ config.py __pycache__/ +cache.sqlite diff --git a/server.py b/server.py new file mode 100644 index 0000000..fbe3a8b --- /dev/null +++ b/server.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +from flask import Flask +from mapbox import Geocoder +import sqlite3 +import config + +geocoder = Geocoder(access_token=config.mapbox_key) +app = Flask(__name__) +cache_db = sqlite3.connect("cache.sqlite") + + +@app.route('/') +def index(): + text = ("To get the weather for a location, run curl " + "https://sky.webionite.com/location. \n" + "Source: https://gitlab.com/ceda_ei/sky\n") + return text + + +def main(location, geocoder, cache_db): + return + + +app.add_url_rule('/', 'location', lambda location: + main(location, geocoder, cache_db))