diff options
-rw-r--r-- | src/server/ApiManagers/SessionManager.ts | 20 | ||||
-rw-r--r-- | src/server/index.ts | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/server/ApiManagers/SessionManager.ts b/src/server/ApiManagers/SessionManager.ts index c993c985f..bcaa6598f 100644 --- a/src/server/ApiManagers/SessionManager.ts +++ b/src/server/ApiManagers/SessionManager.ts @@ -2,7 +2,7 @@ import ApiManager, { Registration } from "./ApiManager"; import { Method, _permission_denied, AuthorizedCore, SecureHandler } from "../RouteManager"; import RouteSubscriber from "../RouteSubscriber"; import { sessionAgent } from ".."; -// import { DashSessionAgent } from "../DashSession/DashSessionAgent"; +import { DashSessionAgent } from "../DashSession/DashSessionAgent"; const permissionError = "You are not authorized!"; @@ -25,15 +25,15 @@ export default class SessionManager extends ApiManager { protected initialize(register: Registration): void { - // register({ - // method: Method.GET, - // subscription: this.secureSubscriber("debug", "to?"), - // secureHandler: this.authorizedAction(async ({ req: { params }, res }) => { - // const to = params.to || DashSessionAgent.notificationRecipient; - // const { error } = await sessionAgent.serverWorker.emit("debug", { to }); - // res.send(error ? error.message : `Your request was successful: the server captured and compressed (but did not save) a new back up. It was sent to ${to}.`); - // }) - // }); + register({ + method: Method.GET, + subscription: this.secureSubscriber("debug", "to?"), + secureHandler: this.authorizedAction(async ({ req: { params }, res }) => { + const to = params.to || DashSessionAgent.notificationRecipient; + const { error } = await sessionAgent.serverWorker.emit("debug", { to }); + res.send(error ? error.message : `Your request was successful: the server captured and compressed (but did not save) a new back up. It was sent to ${to}.`); + }) + }); register({ method: Method.GET, diff --git a/src/server/index.ts b/src/server/index.ts index 8325f5d44..97f70630b 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -22,7 +22,7 @@ import GeneralGoogleManager from "./ApiManagers/GeneralGoogleManager"; import GooglePhotosManager from "./ApiManagers/GooglePhotosManager"; import { Logger } from "./ProcessFactory"; import { yellow } from "colors"; -// import { DashSessionAgent } from "./DashSession/DashSessionAgent"; +import { DashSessionAgent } from "./DashSession/DashSessionAgent"; import SessionManager from "./ApiManagers/SessionManager"; import { AppliedSessionAgent } from "./DashSession/Session/agents/applied_session_agent"; import { Utils } from "../Utils"; @@ -146,7 +146,7 @@ export async function launchServer() { * So, the 'else' clause is exactly what we've always run when executing npm start. */ if (process.env.RELEASE) { - // (sessionAgent = new DashSessionAgent()).launch(); + (sessionAgent = new DashSessionAgent()).launch(); } else { launchServer(); } |