mirror of
https://git.collinwebdesigns.de/oscar.krause/fastapi-dls.git
synced 2024-11-23 23:41:06 +03:00
fixes
This commit is contained in:
parent
04bbca1a3a
commit
36094276ea
10
app/main.py
10
app/main.py
@ -15,12 +15,10 @@ from fastapi import FastAPI
|
|||||||
from fastapi.requests import Request
|
from fastapi.requests import Request
|
||||||
from jose import jws, jwk, jwt, JWTError
|
from jose import jws, jwk, jwt, JWTError
|
||||||
from jose.constants import ALGORITHMS
|
from jose.constants import ALGORITHMS
|
||||||
from starlette.middleware.cors import CORSMiddleware
|
|
||||||
from starlette.responses import StreamingResponse, JSONResponse, Response, RedirectResponse
|
|
||||||
from sqlalchemy import create_engine
|
from sqlalchemy import create_engine
|
||||||
from sqlalchemy.orm import sessionmaker
|
from sqlalchemy.orm import sessionmaker
|
||||||
from starlette.middleware.cors import CORSMiddleware
|
from starlette.middleware.cors import CORSMiddleware
|
||||||
from starlette.responses import StreamingResponse, JSONResponse as JSONr, HTMLResponse as HTMLr, Response, RedirectResponse
|
from starlette.responses import StreamingResponse, JSONResponse as JSONr, Response, RedirectResponse
|
||||||
from starlette.staticfiles import StaticFiles
|
from starlette.staticfiles import StaticFiles
|
||||||
from starlette.templating import Jinja2Templates
|
from starlette.templating import Jinja2Templates
|
||||||
|
|
||||||
@ -91,8 +89,8 @@ async def lifespan(_: FastAPI):
|
|||||||
|
|
||||||
config = dict(openapi_url=None, docs_url=None, redoc_url=None) # dict(openapi_url='/-/openapi.json', docs_url='/-/docs', redoc_url='/-/redoc')
|
config = dict(openapi_url=None, docs_url=None, redoc_url=None) # dict(openapi_url='/-/openapi.json', docs_url='/-/docs', redoc_url='/-/redoc')
|
||||||
app = FastAPI(title='FastAPI-DLS', description='Minimal Delegated License Service (DLS).', version=VERSION, lifespan=lifespan, **config)
|
app = FastAPI(title='FastAPI-DLS', description='Minimal Delegated License Service (DLS).', version=VERSION, lifespan=lifespan, **config)
|
||||||
app.mount('/static', StaticFiles(directory='static', html=True), name='static'),
|
app.mount('/static', StaticFiles(directory=join(dirname(__file__), 'static'), html=True), name='static'),
|
||||||
templates = Jinja2Templates(directory='templates')
|
templates = Jinja2Templates(directory=join(dirname(__file__), 'templates'))
|
||||||
|
|
||||||
app.debug = DEBUG
|
app.debug = DEBUG
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
@ -133,6 +131,8 @@ def __json_config() -> dict:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Endpoints
|
||||||
|
|
||||||
@app.get('/', summary='* Index')
|
@app.get('/', summary='* Index')
|
||||||
async def index():
|
async def index():
|
||||||
return RedirectResponse('/-/')
|
return RedirectResponse('/-/')
|
||||||
|
Loading…
Reference in New Issue
Block a user