MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / getBaseUrl

Function getBaseUrl

server/src/training-agent/index.ts:360–365  ·  view source on GitHub ↗
(req: Request)

Source from the content-addressed store, hash-verified

358}
359
360function getBaseUrl(req: Request): string {
361 if (process.env.BASE_URL) return process.env.BASE_URL.replace(/\/$/, '');
362 const proto = req.headers['x-forwarded-proto'] || req.protocol || 'http';
363 const host = req.headers['x-forwarded-host'] || req.headers.host || 'localhost';
364 return `${proto}://${host}`;
365}
366
367export function createTrainingAgentRouter(): Router {
368 const router = Router();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected