jxtan's picture
Update app.py
66b08d7 verified
raw
history blame
510 Bytes
from fastapi.middleware.cors import CORSMiddleware
from fastapi import FastAPI
import sentence_embeddings
app = FastAPI(docs_url="/", redoc_url=None)
# CORS Support: https://stackoverflow.com/a/66460861
origins = ["*"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(sentence_embeddings.router)
if __name__ == '__main__':
import uvicorn
uvicorn.run(app, host='0.0.0.0', port=8000)