main.py - added health endpoint

This commit is contained in:
Oscar Krause 2022-12-16 13:53:32 +01:00
parent b5cade6a95
commit ca76ab03bb

View File

@ -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():