MCPcopy Index your code
hub / github.com/srcbookdev/srcbook / getFileContent

Function getFileContent

packages/web/src/lib/server.ts:13–24  ·  view source on GitHub ↗
(filename: string)

Source from the content-addressed store, hash-verified

11const API_BASE_URL = `${SRCBOOK_CONFIG.api.origin}/api`;
12
13export async function getFileContent(filename: string) {
14 const file_response = await fetch(API_BASE_URL + '/file', {
15 method: 'POST',
16 headers: {
17 'Content-Type': 'application/json',
18 },
19 body: JSON.stringify({
20 file: filename,
21 }),
22 });
23 return await file_response.json();
24}
25
26interface CreateSrcbookRequestType {
27 path: string;

Callers 1

gotoDefCallbackFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected