Initial commit
This commit is contained in:
14
server/routes/webhooks/strava/index.post.ts
Normal file
14
server/routes/webhooks/strava/index.post.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { get } from "radash";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const body = await readBody(event);
|
||||
const db = useDrizzle();
|
||||
|
||||
const aspectType = get(body, "aspect_type");
|
||||
const objectType = get(body, "object_type");
|
||||
|
||||
await $fetch(`/webhooks/strava/${objectType}-${aspectType}`, {
|
||||
method: "post",
|
||||
body,
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user