From 27a2d3e50e83eed3f29508a281e31cb8bfe31db7 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Tue, 22 Jan 2019 16:06:54 +0530 Subject: [PATCH] Add server base code --- bot/server.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 bot/server.py diff --git a/bot/server.py b/bot/server.py new file mode 100644 index 0000000..52a0f15 --- /dev/null +++ b/bot/server.py @@ -0,0 +1,24 @@ +#!/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)) +app.add_url_rule('/post', 'post', lambda: post(db))