diff --git a/lib/documents.ts b/lib/documents.ts index 3f7d26f..9ce3492 100644 --- a/lib/documents.ts +++ b/lib/documents.ts @@ -3,6 +3,8 @@ import remarkParse from "npm:remark-parse"; import remarkFrontmatter from "https://esm.sh/remark-frontmatter@4"; import { parse } from "https://deno.land/std@0.194.0/yaml/mod.ts"; +const SILVERBULLET_SERVER = Deno.env.get("SILVERBULLET_SERVER"); + export type Document = { name: string; lastModified: number; @@ -19,7 +21,7 @@ export async function getDocuments(): Promise { const headers = new Headers(); headers.append("Accept", "application/json"); - const response = await fetch("http://192.168.178.56:3007/index.json", { + const response = await fetch(SILVERBULLET_SERVER + "/index.json", { headers: headers, }); @@ -27,7 +29,7 @@ export async function getDocuments(): Promise { } export async function getDocument(name: string): Promise { - const response = await fetch("http://192.168.178.56:3007/" + name); + const response = await fetch(SILVERBULLET_SERVER + name); return await response.text(); }