Files
logapi_nuxt/server/api/subspesialis/get/index.get.ts
2025-04-25 15:33:19 +07:00

16 lines
452 B
TypeScript

import axios from "axios";
export default defineEventHandler(async (event) => {
try {
const response = await axios.get("http://10.10.123.140:8082/api/subspesialis");
// console.log(response.data)
return response.data
} catch (error) {
console.error("Error posting to surat kontrol API:", error);
throw createError({
statusCode: 500,
statusMessage: "Failed to fetch data from surat kontrol API",
});
}
});