2019-01-22 11:36:54 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
from flask import Flask
|
|
|
|
import sqlite3
|
|
|
|
|
|
|
|
|
|
|
|
def get(db):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def post(db):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
db = sqlite3.connect(":memory:", check_same_thread=False)
|
|
|
|
|
|
|
|
# Set up tables
|
|
|
|
cursor = db.cursor()
|
|
|
|
with open('schema.sql') as fp:
|
|
|
|
cursor.executescript(fp.read())
|
|
|
|
|
|
|
|
app.add_url_rule('/get', 'get', lambda: get(db))
|
2019-01-22 12:24:57 +01:00
|
|
|
app.add_url_rule('/post', 'post', lambda: post(db), methods=["POST"])
|