Skip to content

Commit e0baf36

Browse files
committed
Make app.constants json based
Also, fixed some of the schema
1 parent ae716f0 commit e0baf36

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

frontend/public/js/app.constants.js

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"default_route": "/dashboard",
3+
"version": "1.2.0",
4+
"service_control_url": "http://localhost:33333/api/",
5+
"monitoring_url": "http://localhost:33633/",
6+
"showPendingRetry": true
7+
}

frontend/src/main.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,7 @@ conditionallyEnableMocking()
2929
const appConstants = await response.json();
3030
window.defaultConfig = appConstants;
3131
} else {
32-
const devConstants = await fetch("js/app.constants.js", {
33-
method: "GET",
34-
});
35-
if (devConstants.ok) {
36-
const scriptText = await devConstants.text();
37-
const script = document.createElement("script");
38-
script.type = "text/javascript";
39-
script.text = scriptText;
40-
document.head.appendChild(script);
41-
}
32+
console.error("Failed to load app constants");
4233
}
4334
})
4435
// eslint-disable-next-line promise/always-return

src/ServiceControl/Infrastructure/WebApi/AppConstantsMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public async Task InvokeAsync(HttpContext context)
2525
{
2626
default_route = "/dashboard",
2727
service_control_url = "api/",
28-
monitoring_urls = new[] { "http://localhost:33633/" },
28+
monitoring_url = "http://localhost:33633/",
2929
showPendingRetry = true,
3030
version = FileVersion
3131
};

0 commit comments

Comments
 (0)