Minor clean up
This commit is contained in:
20
app/main.py
20
app/main.py
@@ -478,6 +478,7 @@ async def fastapi_root(response: Response = Response):
|
||||
response_data['datetime_utc_localize_pst'] = current_datetime_utc_localize_pst_string
|
||||
|
||||
response_data['url_safe_string_4_bytes_1'] = secrets.token_urlsafe(4)
|
||||
|
||||
response_data['url_safe_string_8_bytes_1'] = secrets.token_urlsafe(8)
|
||||
response_data['url_safe_string_8_bytes_2'] = secrets.token_urlsafe(8)
|
||||
response_data['url_safe_string_8_bytes_3'] = secrets.token_urlsafe(8)
|
||||
@@ -500,6 +501,25 @@ async def fastapi_root(response: Response = Response):
|
||||
# ### END ### API Main ### fastapi_root() ###
|
||||
|
||||
|
||||
# ### BEGIN ### API Main ### generate_id_random() ###
|
||||
# NOTE: This is just a quick utility function to generate a bunch of random IDs.
|
||||
# Updated 2022-03-30
|
||||
@app.get('/generate_id_random', tags=['Root'], response_class=PlainTextResponse)
|
||||
async def generate_id_random(response: Response = Response):
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARN, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
response_data = {}
|
||||
|
||||
html_list = '<ul>'
|
||||
for x in range(50):
|
||||
html_list += f'<li>{secrets.token_urlsafe(8)}</li>'
|
||||
html_list += '</ul>'
|
||||
|
||||
return HTMLResponse(content=html_list, status_code=200)
|
||||
# ### END ### API Main ### generate_id_random() ###
|
||||
|
||||
|
||||
# ### BEGIN ### API Main ### sql_test() ###
|
||||
# ### TEST TEST TEST ### #
|
||||
@app.get('/sql_test', tags=['Testing'], response_class=PlainTextResponse)
|
||||
|
||||
Reference in New Issue
Block a user