Coverage for src/backend/main_backend.py: 0%

14 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2023-10-05 14:25 +0000

1import asyncio 

2 

3import uvicorn 

4from fastapi import FastAPI 

5 

6 

7def dummy_function_back_end(x: str) -> str: 

8 """A sample docstring using pep-0257 (https://peps.python.org/pep-0257/) formatting 

9 

10 :param x: a dummy string 

11 :type x: str 

12 

13 :return: a dummy string 

14 :rtype: str 

15 """ 

16 return x 

17 

18app = FastAPI() 

19 

20@app.get('/') 

21async def root(): 

22 print('Sleeping for 1') 

23 await asyncio.sleep(1) 

24 print('Awake') 

25 return {'message': 'hello'} 

26 

27if __name__ == "__main__": 

28 uvicorn.run(app, host="0.0.0.0", port=8000)