diff --git a/ton-http-api/pyTON/main.py b/ton-http-api/pyTON/main.py index e5f726a..6163be6 100644 --- a/ton-http-api/pyTON/main.py +++ b/ton-http-api/pyTON/main.py @@ -16,6 +16,7 @@ from fastapi import FastAPI, Depends, Response, Request, BackgroundTasks from fastapi.params import Body, Query, Param from fastapi.exceptions import HTTPException, RequestValidationError +from fastapi.middleware.cors import CORSMiddleware from starlette.exceptions import HTTPException as StarletteHTTPException from fastapi.responses import JSONResponse from fastapi import status @@ -113,6 +114,14 @@ def main_config(binder): openapi_tags=tags_metadata ) +app.add_middleware( + CORSMiddleware, + allow_credentials=True, + allow_origins=["*"], + allow_methods=["*"], + allow_headers=["*"], +) + tonlib = None