1
0
Fork 0
taevas.xyz/backend/api/infos/coding/kitsudev.ts
Taevas d781f7138f
Make backend/frontend distinction clearer
Helps with eventually adding other pages
Also makes it clear it's the backend that decides what data to send to the frontend
2025-07-08 14:40:35 +02:00

28 linhas
698 B
TypeScript

import { headers, parseJson, type Handler } from "../..";
export type Info = {
name: string
url: string
date: string;
} | undefined;
const username = "Taevas";
export const kitsudev: Handler = async () => {
/** https://kitsunes.dev/api/swagger#/user/userListActivityFeeds */
const kitsudev = await parseJson(await fetch(`https://kitsunes.dev/api/v1/users/${username}/activities/feeds?limit=1`, {headers})) as [{
repo: {
full_name: string
html_url: string
}
created: string
}];
const info: Info = {
name: kitsudev[0].repo.full_name,
url: kitsudev[0].repo.html_url,
date: kitsudev[0].created
};
return Response.json(info, {status: 200});
};