From 67db6dc9af00de625b5c6474ca95d5a3b61a42f9 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Wed, 26 Jul 2023 13:57:13 +0200 Subject: [PATCH] feat: add SILVERBULLET_SERVER env variable --- lib/documents.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); }