ibs/server.py
HeshamTB 2c17903012
init: server workds with tls, needs database models
Signed-off-by: HeshamTB <hishaminv@gmail.com>
2022-03-03 14:42:02 +03:00

27 lines
602 B
Python
Executable File

#/bin/python
import uvicorn
from typing import Optional
from fastapi import FastAPI
from pydantic import BaseModel
class UserAuthForEntity(BaseModel):
username: str
passwd: str
entitiy: int
app = FastAPI()
@app.post("/isauth")
def is_auth(user_auth_for_entity: UserAuthForEntity):
return user_auth_for_entity
if __name__ == '__main__':
#uvicorn server:app --port 8000 --ssl-certfile server.crt --ssl-keyfile server.key
uvicorn.run(
'server:app', port=4433, host='0.0.0.0',
reload=False,
ssl_keyfile='server.key',
ssl_certfile='server.crt')