urlForHttpServer.js 365 B

123456789101112
  1. import { format } from 'url';
  2. export function urlForHttpServer(httpServer) {
  3. const { address, port } = httpServer.address();
  4. const hostname = address === '' || address === '::' ? 'localhost' : address;
  5. return format({
  6. protocol: 'http',
  7. hostname,
  8. port,
  9. pathname: '/',
  10. });
  11. }
  12. //# sourceMappingURL=urlForHttpServer.js.map