Skip to content

Instantly share code, notes, and snippets.

@cosmic-cortex

cosmic-cortex/main.py Secret

Last active May 29, 2020
Embed
What would you like to do?
from fastapi import FastAPI
from pydantic import BaseModel
class User(BaseModel):
email: str
password: str
app = FastAPI()
@app.post("/login")
def login(user: User):
# ...
# do some magic
# ...
return {"msg": "login successful"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment