Skip to content

Commit 5ba7477

Browse files
remove the embedding api
Signed-off-by: Jason McCallister <jason@mccallister.dev>
1 parent 439924d commit 5ba7477

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

serve.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
// always import from jsr:@snaapi/snaapi to ensure the correct version is used, even if the package is installed locally
2-
import { Snaapi } from "jsr:@snaapi/snaapi@0.11.0";
3-
4-
const apiPort = Number(Deno.env.get("API_PORT") ?? "8000");
51
const sitePort = Number(Deno.env.get("SITE_PORT") ?? "8080");
2+
const apiBase = Deno.env.get("API_BASE");
63

7-
// Start the Snaapi API
8-
const app = await Snaapi.app();
9-
await app.listen({ port: apiPort });
10-
console.log(`Snaapi API running on http://localhost:${apiPort}`);
4+
if (!apiBase) {
5+
console.error("API_BASE environment variable is required");
6+
Deno.exit(1);
7+
}
118

12-
// Serve the demo site with the API base URL injected
13-
const apiBase = Deno.env.get("API_BASE") ?? `http://localhost:${apiPort}`;
149
const escapedApiBase = JSON.stringify(apiBase).slice(1, -1);
1510

1611
const html = (

0 commit comments

Comments
 (0)