feat(frontend,API): Add PUT operations, integrate API, add first from engine

This commit is contained in:
2025-02-24 08:29:44 +01:00
parent 7c6b6e428c
commit 12ba5da7be
15 changed files with 312 additions and 231 deletions

View File

@@ -0,0 +1,14 @@
import type { H3Event } from 'h3'
import { joinURL } from 'ufo'
export default defineEventHandler((event: H3Event) => {
const { serverApiBaseUrl, clientProxyBasePath } = useRuntimeConfig().public
const escapedClientProxyBasePath = clientProxyBasePath.replace(/^\//, '\\/')
// Use the escaped value in the regex
const path = event.path.replace(new RegExp(`^${escapedClientProxyBasePath}`), '')
const target = joinURL(serverApiBaseUrl, path)
console.log('🔀 proxying request to', target)
return proxyRequest(event, target)
})

View File

@@ -1,5 +1,5 @@
import { auth } from '../../utils/auth'
import { H3Event } from 'h3'
import type { H3Event } from 'h3'
export default defineEventHandler((event: H3Event) => {
return auth.handler(toWebRequest(event))