Cloudflare Workers
You can run your Restate services as serverless functions on Cloudflare Workers.
You can easily get started using the Workers+Restate template:
You can also add Restate into the standard wrangler init
template, as long
as you have the nodejs_compat
compatibility flag set in wrangler.toml
.
The SDK should be imported with the fetch
component
@restatedev/restate-sdk/fetch
and you would expose your endpoint to the Worker
runtime with export default endpoint().bind(...).handler()
.
You can deploy with wrangler deploy
, and register your deployed
service:
Local development
A Workers dev server can be started on port 9080 using
wrangler dev --port 9080
. wrangler dev
only serves over HTTP1.1, so you'll need to register a local service with: