mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-08 03:26:48 +00:00
19 lines
298 B
Python
19 lines
298 B
Python
from fastapi import FastAPI
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/app")
|
|
def read_main():
|
|
return {"message": "Hello World from main app"}
|
|
|
|
|
|
subapi = FastAPI(openapi_prefix="/subapi")
|
|
|
|
|
|
@subapi.get("/sub")
|
|
def read_sub():
|
|
return {"message": "Hello World from sub API"}
|
|
|
|
|
|
app.mount("/subapi", subapi)
|