from fastapi.middleware.cors import CORSMiddleware from fastapi import FastAPI import sentence_embeddings app = FastAPI() # 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)