From afef98fb86b3bfc21c5f17fc2d692ec7d7d74888 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Fri, 22 Sep 2023 14:53:29 +0200 Subject: [PATCH] feat: functions:serve should announce port via banner (#6019) --- src/commands/functions/functions-serve.mjs | 5 +++++ src/utils/proxy.mjs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/commands/functions/functions-serve.mjs b/src/commands/functions/functions-serve.mjs index 8714e22661b..83c632deb6a 100644 --- a/src/commands/functions/functions-serve.mjs +++ b/src/commands/functions/functions-serve.mjs @@ -2,8 +2,10 @@ import { join } from 'path' import { startFunctionsServer } from '../../lib/functions/server.mjs' +import { printBanner } from '../../utils/banner.mjs' import { acquirePort, getDotEnvVariables, getSiteInformation, injectEnvVariables } from '../../utils/dev.mjs' import { getFunctionsDir } from '../../utils/functions/index.mjs' +import { getProxyUrl } from '../../utils/proxy.mjs' const DEFAULT_PORT = 9999 @@ -55,6 +57,9 @@ const functionsServe = async (options, command) => { state, accountId, }) + + const url = getProxyUrl({ port: functionsPort }) + printBanner({ url }) } /** diff --git a/src/utils/proxy.mjs b/src/utils/proxy.mjs index 96e7f6941eb..71ce81b2816 100644 --- a/src/utils/proxy.mjs +++ b/src/utils/proxy.mjs @@ -658,7 +658,7 @@ const onRequest = async ( } /** - * @param {import('./types.js').ServerSettings} settings + * @param {Pick} settings * @returns */ export const getProxyUrl = function (settings) {