fromfastapiimportFastAPIapp=FastAPI()@app.get("/app")defread_main():return{"message":"Hello World from main app"}subapi=FastAPI()@subapi.get("/sub")defread_sub():return{"message":"Hello World from sub API"}app.mount("/subapi",subapi)
fromfastapiimportFastAPIapp=FastAPI()@app.get("/app")defread_main():return{"message":"Hello World from main app"}subapi=FastAPI()@subapi.get("/sub")defread_sub():return{"message":"Hello World from sub API"}app.mount("/subapi",subapi)
fromfastapiimportFastAPIapp=FastAPI()@app.get("/app")defread_main():return{"message":"Hello World from main app"}subapi=FastAPI()@subapi.get("/sub")defread_sub():return{"message":"Hello World from sub API"}app.mount("/subapi",subapi)