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B,KACnC,QAAQ,MACV,IAEA,QAAQ,GAAG,WAAW,WACpB,EAAO,KAAK,uBAAuB,KACnC,QAAQ,MACV,GACJ,EAEA,QAAQ,IAAM","file":"/npm/fekey-command-localserver@1.0.3/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/fekey-command-localserver@1.0.3/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","#!/usr/bin/env node\n\nvar startServer = function (argv, k_cli, cli, env) {\n    'use strict';\n    var colors     = require('colors'),\n        os         = require('os'),\n        httpServer = require('http-server/lib/http-server'),\n        portfinder = require('portfinder'),\n        opener     = require('opener'),\n        argv       = require('optimist')\n          .boolean('cors')\n          .argv;\n\n    argv._.splice(0, 1)\n\n    var ifaces = os.networkInterfaces();\n\n    if (argv.h || argv.help) {\n      console.log([\n        'usage: http-server [path] [options]',\n        '',\n        'options:',\n        '  -p           Port to use [8080]',\n        '  -a           Address to use [0.0.0.0]',\n        '  -d           Show directory listings [true]',\n        '  -i           Display autoIndex [true]',\n        '  -g --gzip    Serve gzip files when possible [false]',\n        '  -e --ext     Default file extension if none supplied [none]',\n        '  -s --silent  Suppress log messages from output',\n        '  --cors[=headers]   Enable CORS via the \"Access-Control-Allow-Origin\" header',\n        '                     Optionally provide CORS headers list separated by commas',\n        '  -o [path]    Open browser window after starting the server',\n        '  -c           Cache time (max-age) in seconds [3600], e.g. -c10 for 10 seconds.',\n        '               To disable caching, use -c-1.',\n        '  -U --utc     Use UTC time format in log messages.',\n        '',\n        '  -P --proxy   Fallback proxy if the request cannot be resolved. e.g.: http://someurl.com',\n        '',\n        '  -S --ssl     Enable https.',\n        '  -C --cert    Path to ssl cert file (default: cert.pem).',\n        '  -K --key     Path to ssl key file (default: key.pem).',\n        '',\n        '  -r --robots  Respond to /robots.txt [User-agent: *\\\\nDisallow: /]',\n        '  -h --help    Print this list and exit.'\n      ].join('\\n'));\n      process.exit();\n    }\n\n    var port = argv.p || parseInt(process.env.PORT, 10),\n        host = argv.a || '0.0.0.0',\n        ssl = !!argv.S || !!argv.ssl,\n        proxy = argv.P || argv.proxy,\n        utc = argv.U || argv.utc,\n        logger;\n\n    if (!argv.s && !argv.silent) {\n      logger = {\n        info: console.log,\n        request: function (req, res, error) {\n          var date = utc ? new Date().toUTCString() : new Date();\n          if (error) {\n            logger.info(\n              '[%s] \"%s %s\" Error (%s): \"%s\"',\n              date, req.method.red, req.url.red,\n              error.status.toString().red, error.message.red\n            );\n          }\n          else {\n            logger.info(\n              '[%s] \"%s %s\" \"%s\"',\n              date, req.method.cyan, req.url.cyan,\n              req.headers['user-agent']\n            );\n          }\n        }\n      };\n    }\n    else if (colors) {\n      logger = {\n        info: function () {},\n        request: function () {}\n      };\n    }\n\n    if (!port) {\n      portfinder.basePort = 8080;\n      portfinder.getPort(function (err, port) {\n        if (err) { throw err; }\n        listen(port);\n      });\n    }\n    else {\n      listen(port);\n    }\n\n    function listen(port) {\n      var options = {\n        root: argv._[0],\n        cache: argv.c,\n        showDir: argv.d,\n        autoIndex: argv.i,\n        gzip: argv.g || argv.gzip,\n        robots: argv.r || argv.robots,\n        ext: argv.e || argv.ext,\n        logFn: logger.request,\n        proxy: proxy\n      };\n\n      if (argv.cors) {\n        options.cors = true;\n        if (typeof argv.cors === 'string') {\n          options.corsHeaders = argv.cors;\n        }\n      }\n\n      if (ssl) {\n        options.https = {\n          cert: argv.C || argv.cert || 'cert.pem',\n          key: argv.K || argv.key || 'key.pem'\n        };\n      }\n\n      var server = httpServer.createServer(options);\n      server.listen(port, host, function () {\n        var canonicalHost = host === '0.0.0.0' ? '127.0.0.1' : host,\n            protocol      = ssl ? 'https://' : 'http://';\n\n        logger.info(['Starting up http-server, serving '.yellow,\n          server.root.cyan,\n          ssl ? (' through'.yellow + ' https'.cyan) : '',\n          '\\nAvailable on:'.yellow\n        ].join(''));\n\n        if (argv.a && host !== '0.0.0.0') {\n          logger.info(('  ' + protocol + canonicalHost + ':' + port.toString()).green);\n        }\n        else {\n          Object.keys(ifaces).forEach(function (dev) {\n            ifaces[dev].forEach(function (details) {\n              if (details.family === 'IPv4') {\n                logger.info(('  ' + protocol + details.address + ':' + port.toString()).green);\n              }\n            });\n          });\n        }\n\n        if (typeof proxy === 'string') {\n          logger.info('Unhandled requests will be served from: ' + proxy);\n        }\n\n        logger.info('Hit CTRL-C to stop the server');\n        if (argv.o) {\n          opener(\n            protocol + '//' + canonicalHost + ':' + port,\n            { command: argv.o !== true ? argv.o : null }\n          );\n        }\n      });\n    }\n\n    if (process.platform === 'win32') {\n      require('readline').createInterface({\n        input: process.stdin,\n        output: process.stdout\n      }).on('SIGINT', function () {\n        process.emit('SIGINT');\n      });\n    }\n\n    process.on('SIGINT', function () {\n      logger.info('http-server stopped.'.red);\n      process.exit();\n    });\n\n    process.on('SIGTERM', function () {\n      logger.info('http-server stopped.'.red);\n      process.exit();\n    });\n}\n\nexports.run = startServer;"]}