From 56e78de78af6ea41635c67ef1e3c3157c35dde3f Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Sun, 15 Jan 2023 09:57:55 +0100 Subject: [PATCH] adds cors (#96) * adds cors * make format --- cashu/mint/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cashu/mint/app.py b/cashu/mint/app.py index a0c572e..2dc64d9 100644 --- a/cashu/mint/app.py +++ b/cashu/mint/app.py @@ -5,6 +5,7 @@ from fastapi import FastAPI from loguru import logger from starlette.middleware import Middleware from starlette.middleware.base import BaseHTTPMiddleware +from starlette.middleware.cors import CORSMiddleware from cashu.core.settings import DEBUG, VERSION @@ -68,6 +69,8 @@ def create_app(config_object="core.settings") -> FastAPI: # Middleware(CustomHeaderMiddleware), # ] + middleware = [Middleware(CORSMiddleware, allow_origins=["*"])] + app = FastAPI( title="Cashu Mint", description="Ecash wallet and mint with Bitcoin Lightning support.", @@ -76,7 +79,7 @@ def create_app(config_object="core.settings") -> FastAPI: "name": "MIT License", "url": "https://raw.githubusercontent.com/callebtc/cashu/main/LICENSE", }, - # middleware=middleware, + middleware=middleware, ) return app