CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/project/servers/init.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
/* Initialize both the hub and browser servers. */
7
8
import initPidFile from "./pid-file";
9
import initSecretToken from "./secret-token";
10
11
import initAPIServer from "@cocalc/project/http-api/server";
12
import initBrowserServer from "./browser/http-server";
13
import initHubServer from "./hub/tcp-server";
14
15
import { getLogger } from "@cocalc/project/logger";
16
const winston = getLogger("init-project-server");
17
18
export default async function init() {
19
winston.info("Write pid file to disk.");
20
await initPidFile();
21
await initSecretToken(); // must be before servers, since they use this.
22
await initAPIServer();
23
await initBrowserServer();
24
await initHubServer();
25
}
26
27