adds cors (#96)

* adds cors

* make format
This commit is contained in:
calle
2023-01-15 09:57:55 +01:00
committed by GitHub
parent 428cd386b8
commit 56e78de78a

View File

@@ -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