Creating the app
Create the app and bind one or multiple services to it:Mounting Restate app on a FastAPI app
Mounting Restate app on a FastAPI app
If you are using FastAPI, you can mount the Restate app on a route as follows:Then, register the service with Restate specifying this route, here
localhost:9080/restate/v1
.Serving the app
The Python SDK follows the ASGI standard for the serving of the services. Hypercorn and Uvicorn are two popular ASGI servers that you can use to serve your Restate services.Hypercorn
The templates and examples use Hypercorn to serve the services.Hypercorn development server
To use Hypercorn during development, you can run the app with:Hypercorn production server
To run the app in production, we recommend using a configuration file for Hypercorn:hypercorn-config.toml
example.py
file, which contains the app
.