mirror of
https://github.com/Gozargah/Marzban.git
synced 2026-05-17 08:35:56 +03:00
24 lines
537 B
Python
Executable File
24 lines
537 B
Python
Executable File
import logging
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from fastapi_responses import custom_openapi
|
|
from apscheduler.schedulers.background import BackgroundScheduler
|
|
|
|
|
|
app = FastAPI()
|
|
app.openapi = custom_openapi(app)
|
|
scheduler = BackgroundScheduler()
|
|
logger = logging.getLogger('uvicorn.error')
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
|
|
from app import views, jobs # noqa
|
|
|
|
scheduler.start()
|