started actual fastapi server with DB

This commit is contained in:
Jack Case
2025-10-19 15:33:34 +00:00
parent 4931a785a1
commit e90bc1cc72
3 changed files with 69 additions and 0 deletions

28
slopserver/server.py Normal file
View File

@@ -0,0 +1,28 @@
"""API Operations
- signup
- verify email
- Get auth token
- get top x reported domains
- get reports for given domains/pages
- post report
"""
from fastapi import FastAPI
from sqlalchemy import create_engine
from slopserver.models import Domain, Path, User
from slopserver.models import SlopReport
from slopserver.db import select_slop
app = FastAPI()
temp_engine = create_engine("postgresql+psycopg://slop-farmer@192.168.1.163/slop-farmer")
@app.post("/report/")
async def report_slop(report: SlopReport):
pass
@app.post("/check/")
async def check_slop(check: SlopReport):
slop_results = select_slop(check.slop_urls, temp_engine)
return slop_results