allow all origins to request from lnbits

This commit is contained in:
Tiago vasconcelos 2021-12-30 16:09:12 +00:00
parent 32ea1106f9
commit f76ef6b975

View File

@ -1,6 +1,5 @@
import asyncio import asyncio
import importlib import importlib
from lnbits.core.tasks import register_task_listeners
import sys import sys
import traceback import traceback
import warnings import warnings
@ -12,6 +11,7 @@ from fastapi.middleware.gzip import GZipMiddleware
from fastapi.staticfiles import StaticFiles from fastapi.staticfiles import StaticFiles
import lnbits.settings import lnbits.settings
from lnbits.core.tasks import register_task_listeners
from .commands import db_migrate, handle_assets from .commands import db_migrate, handle_assets
from .core import core_app from .core import core_app
@ -45,12 +45,11 @@ def create_app(config_object="lnbits.settings") -> FastAPI:
"/core/static", StaticFiles(directory="lnbits/core/static"), name="core_static" "/core/static", StaticFiles(directory="lnbits/core/static"), name="core_static"
) )
origins = ["http://localhost", "http://localhost:5000"] origins = ["*"]
app.add_middleware( app.add_middleware(
CORSMiddleware, CORSMiddleware,
allow_origins=origins, allow_origins=origins,
allow_credentials=True,
allow_methods=["*"], allow_methods=["*"],
allow_headers=["*"], allow_headers=["*"],
) )