MCPcopy Index your code
hub / github.com/github/docs / checkPortAvailability

Function checkPortAvailability

start-server.js:21–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19}
20
21async function checkPortAvailability() {
22 // Check that the development server is not already running
23 const portInUse = await portUsed.check(port)
24 if (portInUse) {
25 console.log(`\n\n\nPort ${port} is not available. You may already have a server running.`)
26 console.log(
27 `Try running \`npx kill-port ${port}\` to shut down all your running node processes.\n\n\n`
28 )
29 console.log('\x07') // system 'beep' sound
30 process.exit(1)
31 }
32}
33
34async function startServer() {
35 const app = createApp()

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected