24 lines
561 B
TypeScript
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(),
|
|
};
|
|
};
|