MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / findServerUrls

Function findServerUrls

packages/cli/src/commands/dev.ts:440–477  ·  view source on GitHub ↗
(resolvedOptions: ResolvedOptions, framework?: Framework)

Source from the content-addressed store, hash-verified

438}
439
440function findServerUrls(resolvedOptions: ResolvedOptions, framework?: Framework): ServerUrl[] {
441 if (resolvedOptions.tunnel) {
442 logger.info(` Using provided tunnel URL: ${resolvedOptions.tunnel}`);
443 return [{ type: "tunnel", url: resolvedOptions.tunnel }];
444 }
445
446 //create list of hostnames to try
447 const hostnames = [];
448 if (resolvedOptions.hostname) {
449 hostnames.push(resolvedOptions.hostname);
450 }
451 if (framework) {
452 hostnames.push(...framework.defaultHostnames);
453 } else {
454 hostnames.push("localhost");
455 }
456
457 //create list of ports to try
458 const ports = [];
459 if (resolvedOptions.port) {
460 ports.push(resolvedOptions.port);
461 }
462 if (framework) {
463 ports.push(...framework.defaultPorts);
464 } else {
465 ports.push(3000);
466 }
467
468 //create list of urls to try
469 const urls: ResolvedUrl[] = [];
470 for (const hostname of hostnames) {
471 for (const port of ports) {
472 urls.push({ type: "resolved", hostname, port, https: resolvedOptions.https ?? false });
473 }
474 }
475
476 return urls;
477}
478
479async function resolveEndpointUrl(apiUrl: string, apiKey: string, endpoint: ServerEndpoint) {
480 // use tunnel URL if provided

Callers 1

verifyEndpointFunction · 0.85

Calls 1

infoMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…