mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-23 22:29:34 -05:00
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
20 lines
274 B
Python
20 lines
274 B
Python
from fastapi import FastAPI
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/app")
|
|
def read_main():
|
|
return {"message": "Hello World from main app"}
|
|
|
|
|
|
subapi = FastAPI()
|
|
|
|
|
|
@subapi.get("/sub")
|
|
def read_sub():
|
|
return {"message": "Hello World from sub API"}
|
|
|
|
|
|
app.mount("/subapi", subapi)
|