mirror of
https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
synced 2024-11-25 07:48:50 +00:00
main.py - fixed file imports
This commit is contained in:
parent
15acb6fdbe
commit
1f8f85479f
10
app/main.py
10
app/main.py
@ -1,7 +1,7 @@
|
|||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
from hashlib import sha256
|
from hashlib import sha256
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
from os.path import join, dirname
|
||||||
from fastapi import FastAPI, HTTPException
|
from fastapi import FastAPI, HTTPException
|
||||||
from fastapi.requests import Request
|
from fastapi.requests import Request
|
||||||
import json
|
import json
|
||||||
@ -22,8 +22,8 @@ LEASE_EXPIRE_DELTA = relativedelta(minutes=15) # days=90
|
|||||||
|
|
||||||
URL = '192.168.178.196'
|
URL = '192.168.178.196'
|
||||||
SITE_KEY_XID = '00000000-0000-0000-0000-000000000000'
|
SITE_KEY_XID = '00000000-0000-0000-0000-000000000000'
|
||||||
INSTANCE_KEY_RSA = load_key('cert/instance.private.pem')
|
INSTANCE_KEY_RSA = load_key(join(dirname(__file__), 'cert/instance.private.pem'))
|
||||||
INSTANCE_KEY_PUB = load_key('cert/instance.public.pem')
|
INSTANCE_KEY_PUB = load_key(join(dirname(__file__), 'cert/instance.public.pem'))
|
||||||
|
|
||||||
|
|
||||||
@app.get('/')
|
@app.get('/')
|
||||||
@ -291,7 +291,7 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
print(f'> Starting dev-server ...')
|
print(f'> Starting dev-server ...')
|
||||||
|
|
||||||
ssl_keyfile = 'cert/webserver.key'
|
ssl_keyfile = join(dirname(__file__), 'cert/webserver.key')
|
||||||
ssl_certfile = 'cert/webserver.crt'
|
ssl_certfile = join(dirname(__file__), 'cert/webserver.crt')
|
||||||
|
|
||||||
uvicorn.run('main:app', host='0.0.0.0', port=443, ssl_keyfile=ssl_keyfile, ssl_certfile=ssl_certfile, reload=True)
|
uvicorn.run('main:app', host='0.0.0.0', port=443, ssl_keyfile=ssl_keyfile, ssl_certfile=ssl_certfile, reload=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user