This template demonstrates using the Tempo
remote procedure call framework to add real-time, end-to-end typesafe APIs your Cloudflare Workers.
index.ts
is the content of the Workers script.
Code generation is handled by Bebop
and you can find an example schema in greeter.bop
.
The service is implemented in greeter.ts
.
To create a my-project
directory using this template, run:
$ wrangler generate my-project https://github.com/betwixt-labs/template-worker-tempo
If you wish to generate code from your schemas run:
$ npm run build:schemas
# or
$ yarn build:schemas
# or
$ pnpm run build:schemas
Before publishing your code you need to edit wrangler.toml
file and add your Cloudflare account_id
- more information about configuring and publishing your code can be found in the documentation.
Once you are ready, you can publish your code by running the following command:
$ npm run deploy
# or
$ yarn run deploy
# or
$ pnpm run deploy