Skip to content

Commit 9b274d2

Browse files
committed
fix: use config.port instead of undefined listenPort in /api/keys
1 parent 7f363fc commit 9b274d2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@ async function handleManagementAPI(req: Request, url: URL, config: OcxConfig): P
20982098
// ---------------------------------------------------------------------------
20992099
if (url.pathname === "/api/keys" && req.method === "GET") {
21002100
const keys = config.apiKeys ?? [];
2101-
return jsonResponse({ keys: keys.map(k => ({ id: k.id, name: k.name, prefix: k.key.slice(0, 8) + "...", createdAt: k.createdAt })), endpoint: `http://${config.hostname ?? "127.0.0.1"}:${listenPort}/v1/responses` }, 200, req, config);
2101+
return jsonResponse({ keys: keys.map(k => ({ id: k.id, name: k.name, prefix: k.key.slice(0, 8) + "...", createdAt: k.createdAt })), endpoint: `http://${config.hostname ?? "127.0.0.1"}:${config.port ?? 10100}/v1/responses` }, 200, req, config);
21022102
}
21032103

21042104
if (url.pathname === "/api/keys" && req.method === "POST") {

0 commit comments

Comments
 (0)