Files
pendaftaran/server/api/auth.ts
2024-12-27 16:46:43 +07:00

20 lines
575 B
TypeScript

import axios from "axios";
export default defineEventHandler(async (event) => {
const body = await readBody(event);
// const email = body.email
// const password = body.password
console.log(body.email)
console.log(body.password)
try {
const response = await axios.post("http://10.10.150.129:8082/api/login/" + body);
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",
});
}
});