Skip to content

Commit

Permalink
backend intro
Browse files Browse the repository at this point in the history
  • Loading branch information
MisileLab committed Oct 28, 2023
1 parent 2cd13b1 commit d5a5689
Show file tree
Hide file tree
Showing 4 changed files with 449 additions and 0 deletions.
2 changes: 2 additions & 0 deletions projects/xobusy/sunrint-decon/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MONGO_URI

12 changes: 12 additions & 0 deletions projects/xobusy/sunrint-decon/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import Union
from pathlib import Path

from fastapi import FastAPI, Header, status, HTTPException
from pymongo import MongoClient

app = FastAPI()
db = MongoClient(Path("MONGO_URI").read_text().strip())["local"]["schoolfinder"]

async def is_valid(name: str, password: str) -> bool:
return db.find_one({"name":name,"password":password}) != None

Loading

0 comments on commit d5a5689

Please sign in to comment.