Skip to content

Commit

Permalink
Decide on ai_host for non-anoek developers based on OGS_BACKEND
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenAsJade committed Sep 12, 2023
1 parent 2cc1ffb commit 251ea2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/sockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ if (
// if we're developing locally but connecting to the production system, use our local system for estimation
ai_host = `http://localhost:13284`;
console.log("AI Host set to: ", ai_host);
} else if (window.location.hostname === "localhost") {
} else if (process.env.OGS_BACKEND === "LOCAL") {
// if we're a developer using a local server, then use it for ai
ai_host = "http://localhost:13284";
} else if (
// The CI doesn't work with beta. Note that jest in the CI has NODE_ENV==="test".
// the .org exception is for anoek's development environment
// This logic causes web developers who are _not_ using a local server to use Beta for AI.
(process.env.NODE_ENV === "development" && window.location.hostname.indexOf(".org") < 0) ||
window.location.hostname.indexOf("beta") >= 0 ||
window.location.hostname.indexOf("dev") >= 0
Expand Down

0 comments on commit 251ea2f

Please sign in to comment.