All examples use BASE_URL — set it to your deployment URL.
POST/api/number/convert
Convert a number between decimal, binary, octal, and hex bases.
const BASE_URL = "http://localhost:3000";
const res = await fetch(`${BASE_URL}/api/number/convert`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
value: "255",
fromBase: 10 // 2, 8, 10, or 16
})
});
const data = await res.json();
// → { success: true, decimal: "255", binary: "11111111",
// octal: "377", hex: "FF" }