mirror of
				https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
				synced 2025-11-04 05:46:06 +00:00 
			
		
		
		
	main.py - added health endpoint
This commit is contained in:
		@@ -9,7 +9,7 @@ from datetime import datetime, timedelta
 | 
				
			|||||||
from calendar import timegm
 | 
					from calendar import timegm
 | 
				
			||||||
from jose import jws, jwk, jwt
 | 
					from jose import jws, jwk, jwt
 | 
				
			||||||
from jose.constants import ALGORITHMS
 | 
					from jose.constants import ALGORITHMS
 | 
				
			||||||
from starlette.responses import StreamingResponse
 | 
					from starlette.responses import StreamingResponse, JSONResponse
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from app.helper import load_key, private_bytes, public_key
 | 
					from app.helper import load_key, private_bytes, public_key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -28,6 +28,11 @@ async def index():
 | 
				
			|||||||
    return {'hello': 'world'}
 | 
					    return {'hello': 'world'}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@app.get('/status')
 | 
				
			||||||
 | 
					async def status(request: Request):
 | 
				
			||||||
 | 
					    return JSONResponse({'status': 'up'})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# venv/lib/python3.9/site-packages/nls_core_service_instance/service_instance_token_manager.py
 | 
					# venv/lib/python3.9/site-packages/nls_core_service_instance/service_instance_token_manager.py
 | 
				
			||||||
@app.get('/client-token')
 | 
					@app.get('/client-token')
 | 
				
			||||||
async def client_token():
 | 
					async def client_token():
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user