Coverage for docs_src/sub_applications/tutorial001.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-08 03:53 +0000

1from fastapi import FastAPI 1abcde

2 

3app = FastAPI() 1abcde

4 

5 

6@app.get("/app") 1abcde

7def read_main(): 1abcde

8 return {"message": "Hello World from main app"} 1abcde

9 

10 

11subapi = FastAPI() 1abcde

12 

13 

14@subapi.get("/sub") 1abcde

15def read_sub(): 1abcde

16 return {"message": "Hello World from sub API"} 1abcde

17 

18 

19app.mount("/subapi", subapi) 1abcde