From c5cf48dccde5f7d2fdf1756a314bb40fa6614af8 Mon Sep 17 00:00:00 2001 From: OneUptime Copilot Date: Sun, 8 Sep 2024 17:55:13 +0000 Subject: [PATCH] Improved comments on /App/FeatureSet/Home/Static/js/switchUrl.js --- App/FeatureSet/Home/Static/js/switchUrl.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/App/FeatureSet/Home/Static/js/switchUrl.js b/App/FeatureSet/Home/Static/js/switchUrl.js index 5d8ac4886c5..2ee94843124 100755 --- a/App/FeatureSet/Home/Static/js/switchUrl.js +++ b/App/FeatureSet/Home/Static/js/switchUrl.js @@ -1,9 +1,12 @@ let accountsUrl = window.location.origin + "/accounts"; + +// Determine the backend URL based on whether the hostname is 'localhost' let backendUrl = window.location.hostname === "localhost" ? "http://localhost:3002" : window.location.origin + "/api"; +// Redirect user to login page with optional extra path //eslint-disable-next-line function loginUrl(extra) { if (extra) { @@ -12,6 +15,8 @@ function loginUrl(extra) { window.location.href = `${accountsUrl}/login`; } } + +// Redirect user to register page with optional query parameters //eslint-disable-next-line function registerUrl(params) { if (params) { @@ -20,7 +25,9 @@ function registerUrl(params) { window.location.href = `${accountsUrl}/register`; } } + +// Get the URL for submitting a lead form to the backend //eslint-disable-next-line function formUrl() { return `${backendUrl}/lead/`; -} +} \ No newline at end of file