File
Blob: samples/extensions/config.capnp
| 1 | using Workerd = import "/workerd/workerd.capnp"; |
| 2 | using BurritoShop = import "burrito-shop.capnp"; |
| 3 | |
| 4 | const helloWorldExample :Workerd.Config = ( |
| 5 | services = [ (name = "main", worker = .helloWorld) ], |
| 6 | sockets = [ ( name = "http", address = "*:8080", http = (), service = "main" ) ], |
| 7 | extensions = [ BurritoShop.extension ], |
| 8 | ); |
| 9 | |
| 10 | const helloWorld :Workerd.Worker = ( |
| 11 | modules = [ (name = "worker", esModule = embed "worker.js") ], |
| 12 | compatibilityDate = "2022-09-16", |
| 13 | bindings = [ |
| 14 | ( name = "shop", |
| 15 | # wrapped bindings provide specialized API access to inner bindings. |
| 16 | # inner binding will typically include internet service binding, |
| 17 | # but could be arbitrary, including configuration and data. |
| 18 | wrapped = ( |
| 19 | moduleName = "burrito-shop:binding", |
| 20 | innerBindings = [( |
| 21 | name = "recipes", |
| 22 | json = embed "recipes.json" |
| 23 | )], |
| 24 | )) |
| 25 | ], |
| 26 | ); |