How to use the @vue/cli-service/lib/util/prepareURLs function in @vue/cli-service

To help you get started, we’ve selected a few @vue/cli-service examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mathieutu / vue-cli-plugin-express / src / utils / serverUrl.js View on Github external
async findServerUrl (args, defaults) {
    const useHttps = coalesce(args.https, defaults.https);
    const protocol = useHttps ? 'https' : 'http';
    const host = coalesce(args.host, process.env.HOST, defaults.host);
    const port = await findPort(coalesce(args.port, process.env.PORT, defaults.port));
    const urls = prepareURLs(protocol, host, port);

    return {
      protocol,
      host,
      port,
      path,
      networkUrl: urls.lanUrlForTerminal,
      localUrl: format({ protocol, hostname: host, port, pathname: '/' }),
      localUrlForTerminal: urls.localUrlForTerminal,
      localUrlForBrowser: urls.localUrlForBrowser,
    };
  },
};

@vue/cli-service

local service for vue-cli projects

MIT
Latest version published 2 years ago

Package Health Score

61 / 100
Full package analysis