MCPcopy Index your code
hub / github.com/coder/code-server / bindAddrFromArgs

Function bindAddrFromArgs

src/node/cli.ts:807–826  ·  view source on GitHub ↗
(addr: Addr, args: UserProvidedArgs)

Source from the content-addressed store, hash-verified

805 * using the CLI args.
806 */
807export function bindAddrFromArgs(addr: Addr, args: UserProvidedArgs): Addr {
808 addr = { ...addr }
809 if (args["bind-addr"]) {
810 addr = parseBindAddr(args["bind-addr"])
811 }
812 if (process.env.CODE_SERVER_HOST) {
813 addr.host = process.env.CODE_SERVER_HOST
814 }
815 if (args.host) {
816 addr.host = args.host
817 }
818
819 if (process.env.PORT) {
820 addr.port = parseInt(process.env.PORT, 10)
821 }
822 if (args.port !== undefined) {
823 addr.port = args.port
824 }
825 return addr
826}
827
828function bindAddrFromAllSources(...argsConfig: UserProvidedArgs[]): Addr {
829 let addr: Addr = {

Callers 2

cli.test.tsFile · 0.90
bindAddrFromAllSourcesFunction · 0.85

Calls 1

parseBindAddrFunction · 0.85

Tested by

no test coverage detected