Get rid of shared/api
in Netlify functions
This commit is contained in:
parent
aecb5051ae
commit
b4e060c954
12 changed files with 60 additions and 91 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue