useFetch is not defined in server/api
I want to hit the Api using post method in server/api, but whenever i hit it, it return error 500 server error with message "useFetch is not defined"

import { Buffer } from "buffer";
export default defineEventHandler(async (event) => {
const config = useRuntimeConfig();
const body = await readBody(event);
const { data } = await useFetch(`${config.public.midtransEndpoint}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization:
"Basic " +
Buffer.from(`${config.public.midtransServerKey}`).toString("base64"),
},
body: {
body,
},
});
return {
data,
};
});useFetch, useLazyFetch, useAsyncData and useLazyAsyncData only work during setup or Lifecycle Hooks