aboutsummaryrefslogtreecommitdiff
path: root/src/server/index.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-04-17 11:14:59 -0400
committerGitHub <noreply@github.com>2023-04-17 11:14:59 -0400
commit740272abb7fe2f477ee4d53363e04f8c77ed1819 (patch)
tree9b6b59832e9830c9fa9dcb30ad48dcd3163c0e02 /src/server/index.ts
parent8127616d06b4db2b29de0b13068810fd19e77b5e (diff)
parentc2ee641e1f6a8003e961d03550aaffeb668f2545 (diff)
Merge pull request #164 from brown-dash/james-server-stats
Server Stats Endpoint and Frontend View
Diffstat (limited to 'src/server/index.ts')
-rw-r--r--src/server/index.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/index.ts b/src/server/index.ts
index 6562860fe..8b2e18847 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -19,6 +19,7 @@ import { GoogleCredentialsLoader, SSL } from './apis/google/CredentialsLoader';
import { GoogleApiServerUtils } from './apis/google/GoogleApiServerUtils';
import { DashSessionAgent } from './DashSession/DashSessionAgent';
import { AppliedSessionAgent } from './DashSession/Session/agents/applied_session_agent';
+import { DashStats } from './DashStats';
import { DashUploadUtils } from './DashUploadUtils';
import { Database } from './database';
import { Logger } from './ProcessFactory';
@@ -98,6 +99,18 @@ function routeSetter({ isRelease, addSupervisedRoute, logRegistrationOutcome }:
addSupervisedRoute({
method: Method.GET,
+ subscription: '/stats',
+ secureHandler: ({ res }) => DashStats.handleStats(res),
+ });
+
+ addSupervisedRoute({
+ method: Method.GET,
+ subscription: '/statsview',
+ secureHandler: ({ res }) => DashStats.handleStatsView(res),
+ });
+
+ addSupervisedRoute({
+ method: Method.GET,
subscription: '/resolvedPorts',
secureHandler: ({ res }) => res.send(resolvedPorts),
publicHandler: ({ res }) => res.send(resolvedPorts),