diff options
| author | Adam Soltys <[email protected]> | 2025-01-16 14:56:32 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-01-16 14:56:32 -0800 |
| commit | 47904b01b6d2740edd31ee2cc40f072161ccf9c1 (patch) | |
| tree | 49f98fa864c4afe5ee01f6549d62ec3ec28d2968 /src/routes/(app)/post | |
| parent | 8ca023caca8ed8dd0432c15a330c14eed7e397a9 (diff) | |
| download | coinos-ui-47904b01b6d2740edd31ee2cc40f072161ccf9c1.tar.gz coinos-ui-47904b01b6d2740edd31ee2cc40f072161ccf9c1.zip | |
event viewer and zaps
Diffstat (limited to 'src/routes/(app)/post')
| -rw-r--r-- | src/routes/(app)/post/+server.ts | 9 | ||||
| -rw-r--r-- | src/routes/(app)/post/[...path]/+server.ts | 12 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/routes/(app)/post/+server.ts b/src/routes/(app)/post/+server.ts new file mode 100644 index 00000000..35c04186 --- /dev/null +++ b/src/routes/(app)/post/+server.ts @@ -0,0 +1,9 @@ +export async function POST({ cookies, params, request }) { + const body = await request.json(); + try { + const result = await post("/event", body, auth(cookies)); + return json(result); + } catch (e: any) { + error(500, e.message); + } +} diff --git a/src/routes/(app)/post/[...path]/+server.ts b/src/routes/(app)/post/[...path]/+server.ts new file mode 100644 index 00000000..84df9a36 --- /dev/null +++ b/src/routes/(app)/post/[...path]/+server.ts @@ -0,0 +1,12 @@ +import { PUBLIC_COINOS_URL as base } from "$env/static/public"; +import { auth } from "$lib/utils"; + +export async function POST({ cookies, fetch, params, request }) { + const { path } = params; + + return fetch(`${base}/${path}`, { + method: "POST", + body: JSON.stringify(await request.json()), + headers: { "Content-Type": "application/json", ...auth(cookies) }, + }); +} |
