Skip to main content

STORAGE_BINDING

Constant STORAGE_BINDING 

Source
pub const STORAGE_BINDING: &str = "STORAGE";
Expand description

Name of the R2 binding holding every file: STORAGE: bindings.r2({ name: "<app>-storage" }) in cloudflare.config.ts.

The bucket itself is <app>-storage; the first generator that needs it adds the entry, and ocre deploy creates the bucket. Every function of this module fails with Error::Internal naming this entry when the binding is missing.

ยงExamples

assert_eq!(ocre::storage::STORAGE_BINDING, "STORAGE");