Files
memorium/routes/api/articles/[name].ts

11 lines
296 B
TypeScript

import { Handlers } from "$fresh/server.ts";
import { json } from "@lib/helpers.ts";
import { fetchResource } from "@lib/marka.ts";
export const handler: Handlers = {
async GET(_, ctx) {
const article = await fetchResource(`articles/${ctx.params.name}`);
return json(article);
},
};