feat: proper api

This commit is contained in:
TrèsAbhi committed 2026-02-01 00:14:58 -06:00
1 parent ba6a83a9cb
commit 015d457d23
3 files changed
+9 -12

No files matched your search

@@ -1,7 +1,6 @@
---
import "@radix-ui/colors/amber-dark.css";
import { getCollection } from "astro:content";
import { tools } from "../../../core/tools/tools";
import BaseLayout from "../../../layouts/BaseLayout.astro";
export { getStaticPaths } from "../index.astro";
@@ -9,8 +8,6 @@ export { getStaticPaths } from "../index.astro";
const { locale } = Astro.props;
const collection = await getCollection("api");
console.log(collection);
const paths: {
path: string;
documentation: string;
@@ -19,15 +16,14 @@ const paths: {
paths.sort((a, b) => a.path.localeCompare(b.path));
---
<BaseLayout selectedTool={tools.api} {locale} accent="lime">
<BaseLayout {locale} accent="lime">
<h1>api</h1>
{
collection.map(({ id, data }) => (
<>
<h2>{id}</h2>
<pre style="background-color: red;">{data.docs}</pre>
<pre>{data.body}</pre>
<pre>{data.docs}</pre>
</>
))
}
@@ -4,6 +4,9 @@ import { api } from "../../../core/api/dynamic";
export { getStaticPaths } from "./[id].pb";
/**
* Even Noah can't save these animals.
* Even Noah can't save these animals.
* Even Noah can't save these animals.
* Even Noah can't save these animals.
*/
export async function GET({ params }: APIContext<never, { id: string }>) {