mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-08 18:34:59 +01:00
ignore: cloud resource
This commit is contained in:
15
cloud/resource/resource.cloudflare.ts
Normal file
15
cloud/resource/resource.cloudflare.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { env } from "cloudflare:workers"
|
||||
|
||||
export const Resource = new Proxy(
|
||||
{},
|
||||
{
|
||||
get(_target, prop: string) {
|
||||
if (prop in env) {
|
||||
// @ts-expect-error
|
||||
const value = env[prop]
|
||||
return typeof value === "string" ? JSON.parse(value) : value
|
||||
}
|
||||
throw new Error(`"${prop}" is not linked in your sst.config.ts (cloudflare)`)
|
||||
},
|
||||
},
|
||||
) as Record<string, any>
|
||||
Reference in New Issue
Block a user