diff --git a/src/lib/index.ts b/src/lib/index.ts index 3d1b7e0..6b44f34 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -64,3 +64,5 @@ export const createLedClient = (_addr: string) => { // export const twitchClient = createTwitchClient(); // twitchClient.subscribeToFollow(); +// +export const client = createLedClient("192.168.1.215"); diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index 3fd2e9a..12a8f07 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -1,8 +1,6 @@ import { createLedClient } from "$lib"; import { fail, type Actions } from "@sveltejs/kit"; -export const client = createLedClient("192.168.1.215"); - export const actions: Actions = { async default({ request }) { const data = await request.formData(); diff --git a/src/routes/api/webhook/+server.ts b/src/routes/api/webhook/+server.ts index 1431902..12451b9 100644 --- a/src/routes/api/webhook/+server.ts +++ b/src/routes/api/webhook/+server.ts @@ -2,8 +2,7 @@ import { createHmac, timingSafeEqual } from "node:crypto"; import type { RequestHandler } from "@sveltejs/kit"; import { HASH_SECRET } from "$env/static/private"; import { twitchFollowEvent } from "$lib/twitch"; -import { client } from "../../+page.server"; - +import { client } from "$lib"; const getHmacMessage = (request: Request, body: string): string => { return ( request.headers.get(TWITCH_MESSAGE_ID)! +