与 中一样ExpressJS,app.get("/*")适用于所有路线。
我的代码 -
from typing import Optional
from fastapi import FastAPI
app = FastAPI()
@app.get('/*')
def user_lost():
return "Sorry You Are Lost !"
Run Code Online (Sandbox Code Playgroud)
我尝试过,但网页结果显示{"detail":"Not Found"}
How can I do the same in FastApi?