Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for recommended (0.15 sec)

  1. docs/en/docs/release-notes.md

    app = FastAPI(lifespan=lifespan)
    
    
    @app.get("/predict")
    async def predict(x: float):
        result = ml_models["answer_to_everything"](x)
        return {"result": result}
    ```
    
    **Note**: This is the recommended way going forward, instead of using `startup` and `shutdown` events.
    
    Read more about it in the new docs: [Advanced User Guide: Lifespan Events](https://fastapi.tiangolo.com/advanced/events/).
    
    ### Docs
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
Back to top