feat: add SILVERBULLET_SERVER env variable
This commit is contained in:
parent
917ea70f13
commit
67db6dc9af
@ -3,6 +3,8 @@ import remarkParse from "npm:remark-parse";
|
|||||||
import remarkFrontmatter from "https://esm.sh/remark-frontmatter@4";
|
import remarkFrontmatter from "https://esm.sh/remark-frontmatter@4";
|
||||||
import { parse } from "https://deno.land/std@0.194.0/yaml/mod.ts";
|
import { parse } from "https://deno.land/std@0.194.0/yaml/mod.ts";
|
||||||
|
|
||||||
|
const SILVERBULLET_SERVER = Deno.env.get("SILVERBULLET_SERVER");
|
||||||
|
|
||||||
export type Document = {
|
export type Document = {
|
||||||
name: string;
|
name: string;
|
||||||
lastModified: number;
|
lastModified: number;
|
||||||
@ -19,7 +21,7 @@ export async function getDocuments(): Promise<Document[]> {
|
|||||||
const headers = new Headers();
|
const headers = new Headers();
|
||||||
headers.append("Accept", "application/json");
|
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,
|
headers: headers,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -27,7 +29,7 @@ export async function getDocuments(): Promise<Document[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getDocument(name: string): Promise<string> {
|
export async function getDocument(name: string): Promise<string> {
|
||||||
const response = await fetch("http://192.168.178.56:3007/" + name);
|
const response = await fetch(SILVERBULLET_SERVER + name);
|
||||||
return await response.text();
|
return await response.text();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user