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(, process.env.HOST,;
    const port = await findPort(coalesce(args.port, process.env.PORT, defaults.port));
    const urls = prepareURLs(protocol, host, port);

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


local service for vue-cli projects

Latest version published 2 years ago

Package Health Score

71 / 100
Full package analysis