MCPcopy Index your code
hub / github.com/desktop/desktop / getPortOrDefault

Function getPortOrDefault

script/start.ts:12–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10import { createServer } from 'http'
11
12function getPortOrDefault() {
13 const port = process.env.PORT
14 if (port != null) {
15 const result = parseInt(port)
16 if (isNaN(result)) {
17 throw new Error(`Unable to parse '${port}' into valid number`)
18 }
19 return result
20 }
21
22 return 3000
23}
24
25function startApp() {
26 const runningApp = run({ stdio: 'inherit' })

Callers 1

start.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected