Skip to content

Commit

Permalink
feat: functions:serve should announce port via banner (#6019)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt authored Sep 22, 2023
1 parent 61c0be5 commit afef98f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/commands/functions/functions-serve.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -55,6 +57,9 @@ const functionsServe = async (options, command) => {
state,
accountId,
})

const url = getProxyUrl({ port: functionsPort })
printBanner({ url })
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/utils/proxy.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ const onRequest = async (
}

/**
* @param {import('./types.js').ServerSettings} settings
* @param {Pick<import('./types.js').ServerSettings, "https" | "port">} settings
* @returns
*/
export const getProxyUrl = function (settings) {
Expand Down

1 comment on commit afef98f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,365
  • Package size: 366 MB

Please sign in to comment.