Files
rustfs-console/server/api/[...].ts
T
2025-01-22 15:03:10 +08:00

12 lines
322 B
TypeScript

import { joinURL } from 'ufo';
export default defineEventHandler(async (event) => {
const proxyUrl = useRuntimeConfig().public.api.baseURL;
const target = joinURL(proxyUrl, event.path.replace('/rustfs', '/rustfs/admin/v3'));
console.log('Proxying request to:', target);
return proxyRequest(event, target);
});