diff options
| author | Sam Wilkins <samwilkins333@gmail.com> | 2019-12-13 14:25:45 -0500 |
|---|---|---|
| committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-12-13 14:25:45 -0500 |
| commit | 529c9dbe42ab8f732bd8a244246eb1b94c3b5053 (patch) | |
| tree | 13110af32830b25fca4eed583c6f23cee7ecd0ee /src/server/index.ts | |
| parent | a2d2737fa4ec1a57f5288ed72eb44a2be4588ee8 (diff) | |
| parent | 9a90830162cf176b58729385588accf3b589454d (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/server/index.ts')
| -rw-r--r-- | src/server/index.ts | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/server/index.ts b/src/server/index.ts index 3764eaabb..bc481e579 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -18,11 +18,12 @@ import { GoogleCredentialsLoader } from './credentials/CredentialsLoader'; import DeleteManager from "./ApiManagers/DeleteManager"; import PDFManager from "./ApiManagers/PDFManager"; import UploadManager from "./ApiManagers/UploadManager"; -import { log_execution, command_line } from "./ActionUtilities"; +import { log_execution } from "./ActionUtilities"; import GeneralGoogleManager from "./ApiManagers/GeneralGoogleManager"; import GooglePhotosManager from "./ApiManagers/GooglePhotosManager"; import { yellow, red } from "colors"; import { disconnect } from "../server/Initialization"; +import { ProcessFactory, Logger } from "./ChildProcessUtilities/ProcessFactory"; export const publicDirectory = path.resolve(__dirname, "public"); export const filesDirectory = path.resolve(publicDirectory, "files"); @@ -35,6 +36,7 @@ export const ExitHandlers = new Array<() => void>(); * before clients can access the server should be run or awaited here. */ async function preliminaryFunctions() { + await Logger.initialize(); await GoogleCredentialsLoader.loadCredentials(); GoogleApiServerUtils.processProjectCredentials(); await DashUploadUtils.buildFileDirectories(); @@ -119,31 +121,6 @@ function routeSetter({ isRelease, addSupervisedRoute, logRegistrationOutcome }: } }); - let daemonInitialized = false; - addSupervisedRoute({ - method: Method.GET, - subscription: "/persist", - onValidation: async ({ res }) => { - if (!daemonInitialized) { - daemonInitialized = true; - log_execution({ - startMessage: "\ninitializing persistence daemon", - endMessage: ({ result, error }) => { - const success = error === null && result !== undefined; - if (!success) { - console.log(red("failed to initialize the persistance daemon")); - process.exit(0); - } - return "persistence daemon process closed"; - }, - action: async () => command_line("npx ts-node ./persistence_daemon.ts", "./src/server"), - color: yellow - }); - } - res.redirect("/home"); - } - }); - logRegistrationOutcome(); // initialize the web socket (bidirectional communication: if a user changes |
