We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ef4f39 commit ecf4a43Copy full SHA for ecf4a43
app/[docs_id]/page.tsx
@@ -22,9 +22,14 @@ export default async function Page({
22
);
23
} else {
24
const cfAssets = getCloudflareContext().env.ASSETS;
25
- mdContent = await cfAssets!
26
- .fetch(`https://assets.local/docs/${docs_id}.md`)
27
- .then((res) => res.text());
+ const mdRes = await cfAssets!.fetch(
+ `https://assets.local/docs/${docs_id}.md`
+ );
28
+ if (mdRes.ok) {
29
+ mdContent = await mdRes.text();
30
+ } else {
31
+ notFound();
32
+ }
33
}
34
} catch (error) {
35
console.error(error);
0 commit comments