durable functions dx
To start a local Bun server, run bun index.ts (or bun start)
Or, to enable hot reloading run bun --hot index.ts (or bun watch)
To start a local Restate server, run bun restate
The Restate UI is available at http://localhost:9070
NOTE: To register the service with Restate, run bun register
To test the function locally, run curl localhost:8080/df/<key>/run --json '{"name": "Luke"}'
keyshould be a unique ID, like 123 or 456
The execution will be paused until the durable promise is resolved. To resolve the durable promise, run curl localhost:8080/df/14/signal --json '{"id": "<id>"}'
idcan be any string, like "1" or "2"
To check the status of a workflow run, run curl localhost:8080/df/<key>/status
Run bunx cdk deploy to deploy the CDK stack to your AWS account.
NOTE: This requires a deployed Restate server (see https://github.com/restatedev/cdk).
To enable hot reloading for the deployed function and infrastructure, run bunx cdk watch --hotswap
This will also print live logs from the function to stdout.
NOTE: You can view live logs from the function (without running CDK watch mode) by running aws logs tail /aws/lambda/df --follow
To test the deployed function, run curl <API_GATEWAY_URL>/df/<key>/run --json '{"name": "Luke"}'