substrate icon indicating copy to clipboard operation
substrate copied to clipboard

Replace `FastAPI.on_event` by `lifespan` event handler in API template

Open vanolucas opened this issue 2 years ago • 2 comments

Alternative events are now deprecated in FastAPI.

i.e., the method on_event in class FastAPI is deprecated. lifespan event handlers should be used instead.

on_event is used in the FastAPI template in api.py.

Thanks for this great template!

vanolucas avatar Apr 04 '24 12:04 vanolucas

Already done in #222!

lsorber avatar Apr 04 '24 19:04 lsorber

We just merged #222, so I'll go ahead and close this. Thanks for posting this though!

lsorber avatar Apr 05 '24 08:04 lsorber