{"version":3,"sources":["jsdelivr-header.js","/npm/@radicalimaging/static-wado-webserver@1.6.11/lib/index.mjs"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNO,YAAa,iBACb,SAAU,cACV,yBAA0B,mCAC1B,4CACA,6BACA,qBAAsB,6BAEtB,cAAe,4BACf,mBAAoB,0BAe3B,MAAM,eAAiB,UACrB,MAAM,EAAM,UAEZ,eAAe,EAAK,GACpB,EAAI,OAAS,GAAU,CAAC,EACxB,MAAM,KAAE,EAAO,KAAS,EAAI,aAEtB,UAAU,EAAK,GAerB,OAbe,KAAK,aAAa,GAE1B,OACL,CACE,OACA,KAAM,KACN,UAAU,IAEZ,KACE,QAAQ,IAAI,qBAAqB,2BAA8B,IAI5D,CAAG,iBAGG,sBACN,qBAAsB","file":"/npm/@radicalimaging/static-wado-webserver@1.6.11/lib/index.mjs","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@radicalimaging/static-wado-webserver@1.6.11/lib/index.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import express from 'express';\nimport http from 'http';\nimport dicomWebServerConfig from './dicomWebServerConfig.mjs';\nimport '@radicalimaging/static-wado-plugins';\nimport 'regenerator-runtime';\nimport configureProgram from './program/index.mjs';\n\nimport setRoutes from './routes/index.mjs';\nimport setMiddlewares from './middlewares/index.mjs';\n\n/**\n * Serve up the web files\n * Configuration is broken up into several parts:\n * 1. Web Service Configuration - port number, path, localhost only or all hosts or specified\n * 2. Client Service Configuration - one or more static directories containing static client files\n * 3. DICOMweb Service Configuration - a directory or root path to serve, plus one or more dynamic component extension\n *\n * This is basically a simple script that just configures an express app, returning it.  The configuration all comes from the\n * params or the default values.\n *\n * @param {*} params\n * @returns\n */\nconst DicomWebServer = async params => {\n  const app = express();\n\n  setMiddlewares(app, params);\n  app.params = params || {};\n  const { port = 5000 } = app.params;\n\n  await setRoutes(app, params);\n\n  const server = http.createServer(app);\n\n  server.listen(\n    {\n      port,\n      host: '::', // IPv6 wildcard\n      ipv6Only: false, // Allow IPv4 mapped addresses\n    },\n    () => {\n      console.log(`Listening on port ${port} for both IPv4 and IPv6`);\n    }\n  );\n\n  return app;\n};\n\nexport default DicomWebServer;\nexport { dicomWebServerConfig, configureProgram };\n"]}