20 lines
650 B
JavaScript
Executable File
20 lines
650 B
JavaScript
Executable File
const axios = require('axios');
|
|
|
|
async function test() {
|
|
try {
|
|
console.log("Testing POST /api/check-number...");
|
|
// Test a likely valid number (formatting it slightly w/o country code to test formatter)
|
|
const res = await axios.post('http://127.0.0.1:3000/api/check-number', {
|
|
number: '08000000000'
|
|
}, {
|
|
headers: { 'Authorization': 'rahasia123' }
|
|
});
|
|
console.log("Response:", JSON.stringify(res.data, null, 2));
|
|
} catch (e) {
|
|
console.error("Error:", e.message);
|
|
if (e.response) console.error("Data:", e.response.data);
|
|
}
|
|
}
|
|
|
|
test();
|