mirror of
https://github.com/rustfs/console.git
synced 2026-10-31 12:13:27 +08:00
12 lines
304 B
TypeScript
12 lines
304 B
TypeScript
import { joinURL } from 'ufo'
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const proxyUrl = useRuntimeConfig().public.api.baseURL
|
|
|
|
const target = joinURL(proxyUrl, event.path.replace('/api', '/api/v1'))
|
|
|
|
console.log('Proxying request to:', target)
|
|
|
|
return proxyRequest(event, target)
|
|
})
|