mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-20 14:34:25 +00:00
# Which Problems Are Solved Invalid formatting in the login codebase due to invalid prettier configuration # How the Problems Are Solved Fxed .prettierignore wildcards for login source files # Additional Changes Removed .prettierrc file because there is already a prettier.config.mjs file # Additional Context
23 lines
747 B
JavaScript
23 lines
747 B
JavaScript
import * as http from "node:http";
|
|
import * as https from "node:https";
|
|
|
|
const scheme = process.env.ZITADEL_TLS_ENABLED === "true" ? "https" : "http";
|
|
const port = process.env.PORT || "3000";
|
|
const url = new URL(process.argv[2] || `/ui/v2/login/healthy`, `${scheme}://localhost:${port}`);
|
|
|
|
const get = scheme === "https" ? https.get : http.get;
|
|
|
|
try {
|
|
const res = await new Promise((resolve, reject) => {
|
|
// Safe: localhost-only probe, self-signed certs expected
|
|
get(url, { rejectUnauthorized: false }, (res) => {
|
|
res.resume();
|
|
resolve(res);
|
|
}).on("error", reject);
|
|
});
|
|
process.exit(res.statusCode >= 200 && res.statusCode < 400 ? 0 : 1);
|
|
} catch (e) {
|
|
console.error("Healthcheck failed:", e);
|
|
process.exit(1);
|
|
}
|