MCPcopy Create free account
hub / github.com/fontsource/fontsource / getDocsMarkdownResponse

Function getDocsMarkdownResponse

website/app/utils/docs/markdown.server.ts:86–104  ·  view source on GitHub ↗
(pathname: string)

Source from the content-addressed store, hash-verified

84};
85
86export const getDocsMarkdownResponse = async (pathname: string) => {
87 const route = getMarkdownRoute(pathname);
88 if (!route) return null;
89
90 const page = source.getPage(route.split('/').filter(Boolean));
91
92 if (!page) {
93 return new Response('Not found', { status: 404 });
94 }
95
96 const text = await getDocsPageMarkdown(page);
97
98 return new Response(text, {
99 headers: {
100 'Content-Type': 'text/markdown; charset=utf-8',
101 'Cache-Control': 'public, max-age=300',
102 },
103 });
104};

Callers 1

fetchFunction · 0.90

Calls 2

getMarkdownRouteFunction · 0.85
getDocsPageMarkdownFunction · 0.85

Tested by

no test coverage detected