web / server /api /[...].ts
hanbinsite's picture
chore: complete Nuxt 3 project setup with Naive UI, Tailwind, ArtPlayer
d003a1c
Raw History Blame Contribute Delete
285 Bytes
import type { H3Event } from "h3";
export default defineEventHandler(async (event: H3Event) => {
const config = useRuntimeConfig();
const targetPath = event.path.replace(/^\/api/, "");
const target = `${config.apiBaseUrl}${targetPath}`;
return proxyRequest(event, target);
});