Environment Variables
Any number of environment variables can be defined in the schema, which Cloesce will ensure are placed in the Wrangler configuration and made available to the Worker at runtime.
Defining Environment Variables
Note
Variables are restricted to the same set of primitive types as SQLite Types.
To define an environment variable, use the var block in the schema:
vars {
MY_VAR: string
MY_OTHER_VAR: int
}
Inject them into an API endpoint like so:
api Foo {
[inject MY_VAR]
get foo() -> string
}