Add server base code

This commit is contained in:
Ceda EI 2019-01-22 16:06:54 +05:30
parent 7581a15266
commit 27a2d3e50e
1 changed files with 24 additions and 0 deletions

24
bot/server.py Normal file
View File

@ -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))