Skip to content

Generating Cloudflare workerd configuration files with capnproto-rust

Notifications You must be signed in to change notification settings

KianNH/capnproto-rust-workerd-configs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generating Cloudflare workerd configs with capnproto-rust

This is a brief example to demonstrate how you can generate configuration files for Cloudflare workerd using the serialisation feature of capnproto-rust.

Requirements

Updating the schema

I've already included the resulting Rust code in this repository at src/workerd.rs - but it can be updated with:

capnp compile -orust:src/ --src-prefix=schema/ ./schema/workerd.capnp

This will generate a file called workerd_capnp.rs in the src folder - you can rename this if preferred.

Usage

It will output a binary config to stdout, which you can redirect to a file and then use with workerd like so:

cargo run > config.bin
workerd serve -b config.bin
  • The -b flag indicates it is a binary config rather than text.

About

Generating Cloudflare workerd configuration files with capnproto-rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published