{"_id":"@booru/moleculer-multi-serve","_rev":"5-46a4f907f673051e01240f9d328523b5","name":"@booru/moleculer-multi-serve","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.1":{"name":"@booru/moleculer-multi-serve","version":"0.0.1","_id":"@booru/moleculer-multi-serve@0.0.1","maintainers":[{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"}],"homepage":"https://github.com/prasadmadanayake/moleculer-plugins#readme","bugs":{"url":"https://github.com/prasadmadanayake/moleculer-plugins/issues"},"dist":{"shasum":"e411985355f485738d439ce8d8e6dd66e2685b25","tarball":"https://registry.npmjs.org/@booru/moleculer-multi-serve/-/moleculer-multi-serve-0.0.1.tgz","fileCount":5,"integrity":"sha512-fkkLdKeQqXckXEQYXopvALXsp10nElQ4o0RAjt2EtM8Dm0OuU7KH0DP5H6swehapbm/2WULzsxF9JpIIDDNWag==","signatures":[{"sig":"MEUCIQDnpxmxIamtnBDZZL+xOIHeGko/roSgVl71cTDeoeYJ2QIgZEwgK3RO4haFV6IF5cIkKD5uuaK1UX34ozsZLPc01Hs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6958},"main":"dist/main.mjs","type":"module","types":"dist/main.d.ts","exports":{"import":"dist/main.mjs","require":"dist/main.cjs"},"gitHead":"85a4d28593649106c784113d91af24e112626ab9","private":false,"scripts":{"build":"tsc && vite build","publish-pkg":"npm publish --access public","prepublishOnly":"npm run build"},"_npmUser":{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"},"repository":{"url":"git+https://github.com/prasadmadanayake/moleculer-plugins.git","directory":"packages/multi-serve"},"_npmVersion":"10.5.2","description":"- This is to serve multiple static roots using different paths. This uses serve-static under the hood to serve static files.","directories":{},"_nodeVersion":"20.13.1","dependencies":{"serve-static":"^1.15.0","path-to-regexp":"^6.2.2","@types/serve-static":"^1.15.7"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^10.3.12","vite":"^5.2.0","dotenv":"^16.4.5","ts-node":"^10.9.2","moleculer":"^0.14.33","typescript":"^5.2.2","@types/glob":"^8.1.0","@types/node":"^20.12.7","vite-plugin-dts":"^3.8.3"},"peerDependencies":{"moleculer":"*","serve-static":"*","moleculer-web":"*","path-to-regexp":"*"},"bundleDependencies":[],"_npmOperationalInternal":{"tmp":"tmp/moleculer-multi-serve_0.0.1_1716980982707_0.15335266515951318","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@booru/moleculer-multi-serve","version":"0.0.2","_id":"@booru/moleculer-multi-serve@0.0.2","maintainers":[{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"}],"homepage":"https://github.com/prasadmadanayake/moleculer-plugins#readme","bugs":{"url":"https://github.com/prasadmadanayake/moleculer-plugins/issues"},"dist":{"shasum":"d671f218547a7939cb333a150d61cf2a0b44832c","tarball":"https://registry.npmjs.org/@booru/moleculer-multi-serve/-/moleculer-multi-serve-0.0.2.tgz","fileCount":5,"integrity":"sha512-ojEjsiB0wwydtCZ1hZTgk+z/6lsjmZgv5bMiAAHnsxHn1LBFUk1Ne3FXq0yyEBYu4QD0Vh/2CD0DW6szq3+xAA==","signatures":[{"sig":"MEUCIEGnHJ89lwtm8U6phLLbcCEnkMjnCuhtGyZtjWF/kP6ZAiEA1yr+A+D6KasHSAwnCN41tHkDbqhtuU/NXH4QXjpBmLQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7294},"main":"dist/main.mjs","type":"module","types":"dist/main.d.ts","exports":{"import":"dist/main.mjs","require":"dist/main.cjs"},"gitHead":"e493975dda974dc9ae68c199845846788e5532bb","private":false,"scripts":{"build":"tsc && vite build","publish-pkg":"npm publish --access public","prepublishOnly":"npm run build"},"_npmUser":{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"},"repository":{"url":"git+https://github.com/prasadmadanayake/moleculer-plugins.git","directory":"packages/multi-serve"},"_npmVersion":"10.7.0","description":"- This is to serve multiple static roots using different paths. This uses serve-static under the hood to serve static files.","directories":{},"_nodeVersion":"20.14.0","dependencies":{"serve-static":"^1.15.0","path-to-regexp":"^6.2.2","@types/serve-static":"^1.15.7"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^10.3.12","vite":"^5.2.0","dotenv":"^16.4.5","ts-node":"^10.9.2","moleculer":"^0.14.33","typescript":"^5.2.2","@types/glob":"^8.1.0","@types/node":"^20.12.7","vite-plugin-dts":"^3.8.3"},"peerDependencies":{"moleculer":"*","serve-static":"*","moleculer-web":"*","path-to-regexp":"*"},"bundleDependencies":[],"_npmOperationalInternal":{"tmp":"tmp/moleculer-multi-serve_0.0.2_1718079805115_0.7381391145483427","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@booru/moleculer-multi-serve","version":"0.0.3","_id":"@booru/moleculer-multi-serve@0.0.3","maintainers":[{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"}],"homepage":"https://github.com/prasadmadanayake/moleculer-plugins#readme","bugs":{"url":"https://github.com/prasadmadanayake/moleculer-plugins/issues"},"dist":{"shasum":"7527c0b079c5fea282f0578a5b9b889bea0f25af","tarball":"https://registry.npmjs.org/@booru/moleculer-multi-serve/-/moleculer-multi-serve-0.0.3.tgz","fileCount":5,"integrity":"sha512-vuqbLE39PBj6Z16SYVI6bxexMEJeM2qXW1D8I2oPKkao8r/jk6AleYYEm4FW0nHVzBwvjWaMURg81oo2sXwCyg==","signatures":[{"sig":"MEUCIQCemcvbZqf6d/JZ3qVMXWhVeEowPe/XLvcJP67tlYboQQIgQ7FToITXBNMfhvr041XoWLOCsS4mVksu7sDYuvk+3aY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7294},"main":"dist/main.mjs","type":"module","types":"dist/main.d.ts","exports":{"import":"dist/main.mjs","require":"dist/main.cjs"},"gitHead":"f9733f6788bb5d88b643ff0a1c9a3a2696e7f76f","private":false,"scripts":{"build":"tsc && vite build","publish-pkg":"npm publish --access public","prepublishOnly":"npm run build"},"_npmUser":{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"},"repository":{"url":"git+https://github.com/prasadmadanayake/moleculer-plugins.git","directory":"packages/multi-serve"},"_npmVersion":"10.7.0","description":"- This is to serve multiple static roots using different paths. This uses serve-static under the hood to serve static files.","directories":{},"_nodeVersion":"20.14.0","dependencies":{"serve-static":"^1.15.0","path-to-regexp":"^6.2.2","@types/serve-static":"^1.15.7"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^10.3.12","vite":"^5.2.0","dotenv":"^16.4.5","ts-node":"^10.9.2","moleculer":"^0.14.33","typescript":"^5.2.2","@types/glob":"^8.1.0","@types/node":"^20.12.7","vite-plugin-dts":"^3.8.3"},"peerDependencies":{"moleculer":"*","serve-static":"*","moleculer-web":"*","path-to-regexp":"*"},"bundleDependencies":[],"_npmOperationalInternal":{"tmp":"tmp/moleculer-multi-serve_0.0.3_1718080158109_0.06515590529535897","host":"s3://npm-registry-packages"}},"0.0.7":{"name":"@booru/moleculer-multi-serve","version":"0.0.7","_id":"@booru/moleculer-multi-serve@0.0.7","maintainers":[{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"}],"homepage":"https://github.com/prasadmadanayake/moleculer-plugins#readme","bugs":{"url":"https://github.com/prasadmadanayake/moleculer-plugins/issues"},"dist":{"shasum":"30ca37504776167bbe1004127e1bfcb66de99f02","tarball":"https://registry.npmjs.org/@booru/moleculer-multi-serve/-/moleculer-multi-serve-0.0.7.tgz","fileCount":5,"integrity":"sha512-9mVC6LfMmpajN99Ojjcy0DtW1sv9B4ENLts6FrAVHl9iCRc74PJ0CiE/tnb51LQhtPtSpf8++M/iTQDkCQGF5Q==","signatures":[{"sig":"MEYCIQCCc5pqkd3B6+G4Pnn8TRI2WtvpPVduICtHRl8c2ZeTPgIhAJ8DogppDj0zbWeRIe0DAXQdDr6fAkYDtX1QGtfxn+N/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7272},"main":"dist/main.mjs","type":"module","types":"dist/main.d.ts","exports":{"import":"./dist/main.mjs","require":"./dist/main.cjs"},"gitHead":"31c51040e22518b25a192369d965d105e0aa6360","private":false,"scripts":{"build":"tsc && vite build","publish-pkg":"npm publish --access public","prepublishOnly":"npm run build"},"_npmUser":{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"},"repository":{"url":"git+https://github.com/prasadmadanayake/moleculer-plugins.git","directory":"packages/multi-serve"},"_npmVersion":"10.7.0","description":"- This is to serve multiple static roots using different paths. This uses serve-static under the hood to serve static files.","directories":{},"_nodeVersion":"20.15.0","dependencies":{"serve-static":"^1.15.0","path-to-regexp":"^6.2.2","@types/serve-static":"^1.15.7"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^5.2.0","dotenv":"^16.4.5","ts-node":"^10.9.2","moleculer":"^0.14.33","tiny-glob":"^0.2.9","typescript":"^5.2.2","@types/node":"^20.12.7","vite-plugin-dts":"^3.8.3"},"peerDependencies":{"moleculer":"*","serve-static":"*","moleculer-web":"*","path-to-regexp":"*"},"bundleDependencies":[],"_npmOperationalInternal":{"tmp":"tmp/moleculer-multi-serve_0.0.7_1721123583640_0.5974881370931164","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@booru/moleculer-multi-serve","private":false,"version":"1.0.0","type":"module","main":"dist/main.mjs","types":"dist/main.d.ts","exports":{"import":"./dist/main.mjs","types":"./dist/main.d.ts","require":"./dist/main.cjs"},"scripts":{"build":"tsc && vite build","prepublishOnly":"npm run build","publish-pkg":"npm publish --access public"},"repository":{"url":"git+https://github.com/prasadmadanayake/moleculer-plugins.git","directory":"packages/multi-serve"},"dependencies":{"path-to-regexp":"^8.3.0","serve-static":"^2.2.1","@types/serve-static":"^2.2.0"},"peerDependencies":{"moleculer":"*","moleculer-web":"*","path-to-regexp":"*","serve-static":"*"},"devDependencies":{"typescript":"~5.9.3","vite":"^8.0.2","@types/node":"^22.13.14","vite-plugin-dts":"^4.5.4","moleculer":"^0.14.35","ts-node":"^10.9.2","dotenv":"^17.3.1","tiny-glob":"^0.2.9"},"_id":"@booru/moleculer-multi-serve@1.0.0","bundleDependencies":[],"gitHead":"33e079d7e0dc5c0c84a0c0989b38eda71f5033c0","description":"- This is to serve multiple static roots using different paths. This uses serve-static under the hood to serve static files.","bugs":{"url":"https://github.com/prasadmadanayake/moleculer-plugins/issues"},"homepage":"https://github.com/prasadmadanayake/moleculer-plugins#readme","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-pnXBwupB1fkm1MN/Qt1wE339BKbHswqpZQ0zdcKvoYlanghnMWt592GjWbmNHE7QLEB+OE4Y8iCY4mnRvwu52g==","shasum":"3bb7883a69c8e3c89fc5ea21342c6423b9d28508","tarball":"https://registry.npmjs.org/@booru/moleculer-multi-serve/-/moleculer-multi-serve-1.0.0.tgz","fileCount":5,"unpackedSize":8004,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFDk58EUWnrMge79I2syp5FqWvqrZ/VUU9ZV2rez4oJ4AiEA6VGb5ZpIZCwY1ziIbpjF8CH0x3jkjoklwhQSGOGR4zs="}]},"_npmUser":{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"},"directories":{},"maintainers":[{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/moleculer-multi-serve_1.0.0_1774342693099_0.0204985495148724"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-29T11:09:42.583Z","modified":"2026-03-24T08:58:13.402Z","0.0.1":"2024-05-29T11:09:42.861Z","0.0.2":"2024-06-11T04:23:25.328Z","0.0.3":"2024-06-11T04:29:18.255Z","0.0.7":"2024-07-16T09:53:03.788Z","1.0.0":"2026-03-24T08:58:13.253Z"},"bugs":{"url":"https://github.com/prasadmadanayake/moleculer-plugins/issues"},"homepage":"https://github.com/prasadmadanayake/moleculer-plugins#readme","repository":{"url":"git+https://github.com/prasadmadanayake/moleculer-plugins.git","directory":"packages/multi-serve"},"description":"- This is to serve multiple static roots using different paths. This uses serve-static under the hood to serve static files.","maintainers":[{"name":"prasadmadanayake","email":"prasadmadanayake7@gmail.com"}],"readme":"# Plugin to serve multiple roots from moleculer-web applications\r\n\r\n## Why\r\n- This is to serve multiple static roots using different paths. This uses serve-static under the hood to serve static files.\r\n\r\n\r\n## Usage\r\n- install moleculer-multi-serve as dev dependency\r\n  - `npm i @booru/moleculer-multi-serve`\r\n  - you may also need to install following to fully setup moleculer app\r\n    - dependencies\r\n      - `moleculer`\r\n      - `moleculer-web` \r\n- add roots to serve as\r\n``` ts\r\nsettings: ServiceSettingSchema ={\r\n    serve: {\r\n      '/fe1/x': {folder: 'dist/fe1'},\r\n      '/fe2/y': {folder: 'dist/fe2'},\r\n      '/fe3/z': {folder: 'dist/fe3'},\r\n      '/fe4/q': {folder: 'dist/fe4'},\r\n\r\n    }\r\n  }\r\n``` \r\n- full sample\r\n```ts\r\nimport {ServiceSchema, ServiceSettingSchema} from \"moleculer\";\r\nimport APIGateway from 'moleculer-web'\r\nimport {ServeMixin} from '@booru/moleculer-multi-serve'\r\n\r\nexport class MainServiceSchema implements Partial<ServiceSchema>{\r\n  name:string  =  \"main3\"\r\n  mixins: Partial<ServiceSchema>[] =  [ APIGateway, new ServeMixin()]\r\n  settings: ServiceSettingSchema = {\r\n    serve: {\r\n      '/fe1/x': {folder: 'dist/fe1'},\r\n      '/fe2/y': {folder: 'dist/fe2'},\r\n      '/fe3/z': {folder: 'dist/fe3'},\r\n      '/fe4/q': {folder: 'dist/fe4'},\r\n\r\n    },\r\n    port: process.env.PORT || 3000,\r\n    routes: [\r\n      {\r\n        path: \"/api/v2\",\r\n        whitelist: [\r\n          \"**\",\r\n        ],\r\n        authorization: false,\r\n        autoAliases: true,\r\n        mappingPolicy: 'restrict',\r\n        cors: true,\r\n        bodyParsers: {\r\n          json: {\r\n            strict: false,\r\n          },\r\n          urlencoded: {\r\n            extended: false,\r\n          },\r\n        },\r\n      }\r\n    ]\r\n  }\r\n}\r\n\r\n```\r\n","readmeFilename":"ReadMe.md"}