modal.fastapi_endpoint
Convert a function into a basic web endpoint by wrapping it with a FastAPI App.
Modal will internally use FastAPI to expose a
simple, single request handler. If you are defining your own FastAPI application
(e.g. if you want to define multiple routes), use @modal.asgi_app instead.
The endpoint created with this decorator will automatically have CORS enabled and can leverage many of FastAPI’s features.
For more information on using Modal with popular web frameworks, see our guide on web endpoints.
Added in v0.73.82: This function replaces the deprecated @web_endpoint decorator.