All examples use BASE_URL — set it to your deployment URL.
POST/api/convert/env-to-json
Convert .env format text to a JSON object.
const res = await fetch(`${BASE_URL}/api/convert/env-to-json`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ env: "DB_HOST=localhost\nDB_PORT=5432" })
});
// → { success: true, result: { DB_HOST: "localhost", DB_PORT: "5432" } }
POST/api/convert/json-to-env
Convert a flat JSON object to .env format text.
const res = await fetch(`${BASE_URL}/api/convert/json-to-env`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ json: '{"DB_HOST":"localhost","DB_PORT":"5432"}' })
});
// → { success: true, result: "DB_HOST=localhost\nDB_PORT=5432" }