mirror of
				https://git.collinwebdesigns.de/oscar.krause/fastapi-dls.git
				synced 2025-10-26 18:05:28 +03:00 
			
		
		
		
	fixes
This commit is contained in:
		
							parent
							
								
									e9f6e21dce
								
							
						
					
					
						commit
						af9e910ab0
					
				
							
								
								
									
										10
									
								
								app/main.py
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								app/main.py
									
									
									
									
									
								
							@ -15,12 +15,10 @@ from fastapi import FastAPI
 | 
			
		||||
from fastapi.requests import Request
 | 
			
		||||
from jose import jws, jwk, jwt, JWTError
 | 
			
		||||
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.orm import sessionmaker
 | 
			
		||||
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.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')
 | 
			
		||||
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'),
 | 
			
		||||
templates = Jinja2Templates(directory='templates')
 | 
			
		||||
app.mount('/static', StaticFiles(directory=join(dirname(__file__), 'static'), html=True), name='static'),
 | 
			
		||||
templates = Jinja2Templates(directory=join(dirname(__file__), 'templates'))
 | 
			
		||||
 | 
			
		||||
app.debug = DEBUG
 | 
			
		||||
app.add_middleware(
 | 
			
		||||
@ -133,6 +131,8 @@ def __json_config() -> dict:
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Endpoints
 | 
			
		||||
 | 
			
		||||
@app.get('/', summary='* Index')
 | 
			
		||||
async def index():
 | 
			
		||||
    return RedirectResponse('/-/')
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user