Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. docs_src/events/tutorial002.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.on_event("shutdown")
    def shutdown_event():
        with open("log.txt", mode="a") as log:
            log.write("Application shutdown")
    
    
    @app.get("/items/")
    async def read_items():
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 255 bytes
    - Viewed (0)
Back to top