Files
logapi_nuxt/.output/server/chunks/routes/api/satu_rssa/index.post.mjs
T
2025-06-16 09:14:36 +07:00

29 lines
846 B
JavaScript

import { c as defineEventHandler, r as readBody, e as createError } from '../../../_/nitro.mjs';
import axios from 'axios';
import 'node:http';
import 'node:https';
import 'node:fs';
import 'node:url';
import '@iconify/utils';
import 'consola/core';
const index_post = defineEventHandler(async (event) => {
const body = await readBody(event);
console.log(body);
try {
console.log("MASUK DALAM SINI");
const response = await axios.post("http://10.10.123.140:8082/api/kunjunganpasien/listkunjunganpasien", body);
console.log(response.data);
return response.data;
} catch (error) {
console.error("Error posting to API:", error);
throw createError({
statusCode: 500,
statusMessage: "Failed to fetch data from API"
});
}
});
export { index_post as default };
//# sourceMappingURL=index.post.mjs.map