Version metadata
The running build's id, project name and build time, baked into the binary.
Configuration
"version_metadata": "VERSION"
Usage
export default {
async fetch(request, env, ctx) {
return Response.json({
id: env.VERSION.id, // matches the artifact shown by `sproutboat versions list`
tag: env.VERSION.tag, // the project name
timestamp: env.VERSION.timestamp, // when the binary was built, ISO 8601
});
},
} satisfies ExportedHandler<Env>;
The values are baked into the binary at build time, so reading them makes no binding call.