Files
hipmi-mobile/lib/api.ts
Bagasbanuna02 0b6c360500 API
Add: Screen root
2025-08-18 11:45:06 +08:00

24 lines
629 B
TypeScript

const API_BASE = (path: string) => {
// const url = "https://stg-hipmi.wibudev.com/";
const url = "http://172.20.173.254:3000/";
return `${url}/${path}`;
};
export async function apiVersion() {
const response = await fetch(API_BASE("api/version"));
const data = await response.json();
return data;
}
export async function apiLogin({ nomor }: { nomor: string }) {
const response = await fetch(API_BASE("api/auth/login"), {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ nomor: nomor }),
});
const data = await response.json();
return data;
}