diff --git a/server/requirements.txt b/server/requirements.txt index 52d41a3..e28f356 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -1,2 +1,4 @@ flask jedi +sqlalchemy +mysqlclient diff --git a/server/server.py b/server/server.py index 939ed96..610fa73 100755 --- a/server/server.py +++ b/server/server.py @@ -1,22 +1,23 @@ #!/usr/bin/env python from flask import Flask, jsonify, request +from sqlalchemy import create_engine, text, Table, select, MetaData, inspect, Column import time app = Flask(__name__) - -services = [] - -class Service: - def __init__(self, name): - self.__name = name - services.append(self) - - def getName(self): - return self.__name - - def setName(self, name): - self.__name = name +engine = create_engine('mysql://root:root@172.17.0.1:3305/area', echo=False) +connection = engine.connect() +metadata = MetaData() +insp = inspect(engine) +print(insp.get_table_names()) +users = Table('users', metadata) + +query = select([users]) +#print(query) + +@app.route("/user") +def users(): + return @app.route("/about.json") def about():