MCPcopy Create free account
hub / github.com/anomalyco/models.dev / run

Function run

sst.config.ts:10–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8 };
9 },
10 async run() {
11 const { spawnSync } = await import("child_process");
12
13 const ret = spawnSync("./script/build.ts", [], {
14 cwd: "./packages/web",
15 stdio: "inherit",
16 });
17 if (ret.status !== 0) throw new Error("Build failed");
18
19 const worker = new sst.cloudflare.Worker("Server", {
20 url: true,
21 domain: $app.stage === "dev" ? "models.dev" : undefined,
22 link: [
23 new sst.Secret("PosthogToken"),
24 new sst.Secret("LakeUrl"),
25 new sst.Secret("LakeSecret"),
26 ],
27 handler: "./packages/function/src/worker.ts",
28 assets: {
29 directory: "./packages/web/dist",
30 },
31 transform: {
32 worker: {
33 observability: { enabled: true },
34 },
35 },
36 });
37
38 return {
39 url: worker.url,
40 };
41 },
42});

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected