11 lines
288 B
TypeScript
11 lines
288 B
TypeScript
import { Handlers } from "$fresh/server.ts";
|
|
import { getArticle } from "@lib/resource/articles.ts";
|
|
import { json } from "@lib/helpers.ts";
|
|
|
|
export const handler: Handlers = {
|
|
async GET(_, ctx) {
|
|
const article = await getArticle(ctx.params.name);
|
|
return json(article);
|
|
},
|
|
};
|