Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/backend/port.ts
1447 views
1
/* Determine the port that the hub will serve on.
2
3
If the environment variable PORT is set, use that port; otherwise, use port 5000.
4
5
The default export of this module is the port number.
6
*/
7
8
const DEFAULT_PORT = 5000;
9
10
function port(): number {
11
if (process.env.PORT) {
12
return parseInt(process.env.PORT);
13
}
14
return DEFAULT_PORT;
15
}
16
17
export default port();
18
19