mirror of
https://github.com/fmhy/edit.git
synced 2025-08-02 09:12:12 +10:00
wip
This commit is contained in:
parent
3e37eb6bc4
commit
1d73378e5f
5 changed files with 150 additions and 0 deletions
18
api/routes/outbound.post.ts
Normal file
18
api/routes/outbound.post.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
export default defineEventHandler(async (event) => {
|
||||
const env = useRuntimeConfig(event)
|
||||
const data = await event.web.request.json()
|
||||
|
||||
console.info(data)
|
||||
const forwardHeaders = new Headers(data.headers)
|
||||
forwardHeaders.delete('cookie')
|
||||
|
||||
const upstreamResp = await fetch(`${env.ANALYTICS_DOMAIN}/api/event`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
headers: forwardHeaders
|
||||
})
|
||||
|
||||
console.info(upstreamResp)
|
||||
|
||||
return new Response(null, { status: upstreamResp.status })
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue