We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acb8e5c commit c825e10Copy full SHA for c825e10
1 file changed
src/lib/port.ts
@@ -1,9 +1,11 @@
1
+import consola from "consola"
2
import { getPort } from "get-port-please"
3
4
import { configManager } from "./config"
5
6
export async function initializePort(): Promise<number> {
7
const config = configManager.getConfig()
8
+ const requestedPort = config.PORT
9
10
const port = await getPort({
11
name: "copilot-api",
@@ -12,6 +14,12 @@ export async function initializePort(): Promise<number> {
12
14
random: false,
13
15
})
16
17
+ if (port !== requestedPort) {
18
+ consola.warn(
19
+ `Default port ${requestedPort} is already in use. Using port ${port} instead.`,
20
+ )
21
+ }
22
+
23
configManager.setConfig({ PORT: port })
24
25
return port
0 commit comments