wip: cloud
This commit is contained in:
parent
b40c02e258
commit
c3a25eff78
18 changed files with 83 additions and 51 deletions
14
cloud/core/src/util/resource.ts
Normal file
14
cloud/core/src/util/resource.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { env } from "cloudflare:workers";
|
||||
|
||||
export const Resource = new Proxy(
|
||||
{},
|
||||
{
|
||||
get(_target, prop: string) {
|
||||
if (prop in env) {
|
||||
const value = env[prop];
|
||||
return typeof value === "string" ? JSON.parse(value) : value;
|
||||
}
|
||||
throw new Error(`"${prop}" is not linked in your sst.config.ts`);
|
||||
},
|
||||
}
|
||||
) as Record<string, any>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue