Files
hipmi-mobile/lib/api.ts
Bagasbanuna02 a4825343ba API
Add: service api
-  service/
- app.config.js
- app.json.backup

Package:
- react-native-dotenv
- expo-module-scripts

### No Issue
2025-08-19 11:07:42 +08:00

24 lines
633 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 apiLoginBack({ 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;
}