add basic flask server and requirements
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# To connect to PostgreSQL database
|
||||
import psycopg2
|
||||
from psycopg2 import sql
|
||||
|
||||
from psycopg2.extras import RealDictCursor
|
||||
from typing import List, Dict, Any, Optional
|
||||
from typing import Optional
|
||||
|
||||
class Database:
|
||||
def __init__(self, db_name: str, user: str, password: str, host: str = 'localhost', port: int = 5432):
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
psycopg2==2.9.11
|
||||
psycopg2-binary==2.9.11
|
||||
flask==3.1.2
|
||||
12
server/app.py
Normal file
12
server/app.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from flask import Flask
|
||||
from db.database import Database
|
||||
|
||||
app = Flask(__name__)
|
||||
db = Database(db_name='ethnograph', user='user', password='password')
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return "Welcome to the Ethnograph View Server!"
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
Reference in New Issue
Block a user