urlForHttpServer.js 526 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.urlForHttpServer = void 0;
  4. const url_1 = require("url");
  5. function urlForHttpServer(httpServer) {
  6. const { address, port } = httpServer.address();
  7. const hostname = address === '' || address === '::' ? 'localhost' : address;
  8. return (0, url_1.format)({
  9. protocol: 'http',
  10. hostname,
  11. port,
  12. pathname: '/',
  13. });
  14. }
  15. exports.urlForHttpServer = urlForHttpServer;
  16. //# sourceMappingURL=urlForHttpServer.js.map