Created
June 25, 2023 04:22
-
-
Save j-thepac/e766017c8f866087df7bf56a449d5d1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI,Request | |
from pydantic import BaseModel | |
import uvicorn | |
from smslottery import validate_bet | |
from fastapi.middleware.cors import CORSMiddleware | |
origins = ["*"] | |
class Data(BaseModel): | |
game:str | |
text:str | |
app= FastAPI() | |
app.add_middleware( | |
CORSMiddleware, | |
allow_origins=["*"], | |
allow_methods=["*"], | |
allow_headers=["*"], | |
) | |
@app.post("/") | |
def fn(d:Data):return d.game+g.text | |
if(__name__=="__main__"):uvicorn.run("server:app",host="localhost",port=4321) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment