frontend/src/routes/market-mover/premarket/+page.server.ts
2024-11-06 15:15:13 +01:00

24 lines
561 B
TypeScript

export const load = async ({ locals }) => {
const { apiURL, apiKey } = locals;
const getMarketMover = async () => {
const postData = { params: "premarket" };
const response = await fetch(apiURL + "/pre-after-market-movers", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": apiKey,
},
body: JSON.stringify(postData),
});
const output = await response.json();
return output;
};
return {
getMarketMover: await getMarketMover(),
};
};