Get rid of shared/api in Netlify functions

This commit is contained in:
Taevas 2025-03-02 14:37:13 +01:00
parent aecb5051ae
commit b4e060c954
12 changed files with 60 additions and 91 deletions

View file

@ -1,13 +1,12 @@
import {type Handler} from "@netlify/functions";
import {api} from "./shared/api.js";
import {type HacktheboxInfo} from "#Infos/Hacking/Hackthebox.js";
const handler: Handler = async () => {
const hackthebox = await api<{
const hackthebox = await (await fetch("https://www.hackthebox.com/api/v4/profile/activity/1063999")).json() as {
profile: {
activity: HacktheboxInfo[];
};
}>("https://www.hackthebox.com/api/v4/profile/activity/1063999");
};
const pwn = hackthebox.profile.activity.find((a: HacktheboxInfo) => a?.object_type === "machine");
if (!pwn) {