{"_id":"@blubox/gateway","_rev":"4-2873a010d26b60fc492465f67c7b336e","name":"@blubox/gateway","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"@blubox/gateway","version":"0.0.1","description":"Blubox Gateway","main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"private":false,"publishConfig":{"access":"public"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"license":"MIT","keywords":["gateway","blubox-gateway","blubox","@blubox/gateway"],"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --minify terser","prepublishOnly":"npm run build"},"devDependencies":{"terser":"^5.21.0","tsup":"^7.2.0","typescript":"^5.2.2"},"peerDependencies":{"blubox":">=0.0.4"},"dependencies":{"axios":"^1.5.1","normalize-url":"^4.5.1"},"_id":"@blubox/gateway@0.0.1","gitHead":"925aed443b1c000dc320ebfb4d26c4dd66b520fd","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"homepage":"https://github.com/gnzcode/blubox#readme","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-w7QYVHGuyul5C1+3gNfvTo0a87XLWVdhabLd2hMOb5w75Q/sBZSzoDWLSzsQLSbbs956FvqsS+XvA56M4GcxzA==","shasum":"38ef42f47f7c3459f2fb21e27f9664b701032b68","tarball":"https://registry.npmjs.org/@blubox/gateway/-/gateway-0.0.1.tgz","fileCount":6,"unpackedSize":6325,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQW06rk4ZAJiYCJffS+NfWORxxEDSkD2LT0E6LqWb/mAIhAIKhOxNoo2nOeERXHs34loAsYWoVvPmZI/9eufkZCfdx"}]},"_npmUser":{"name":"gnzcode","email":"gnzcode@gmail.com"},"directories":{},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gateway_0.0.1_1697334586321_0.9581253972356334"},"_hasShrinkwrap":false},"0.0.2":{"name":"@blubox/gateway","version":"0.0.2","description":"Blubox Gateway","main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"private":false,"publishConfig":{"access":"public"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"license":"MIT","keywords":["gateway","blubox-gateway","blubox","@blubox/gateway"],"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --minify terser","prepublishOnly":"npm run build"},"devDependencies":{"terser":"^5.21.0","tsup":"^7.2.0","typescript":"^5.2.2"},"peerDependencies":{"blubox":">=0.0.4"},"dependencies":{"axios":"^1.5.1","normalize-url":"^4.5.1"},"_id":"@blubox/gateway@0.0.2","gitHead":"ac239130b22d69156a22c1316e60cead1a139bcf","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"homepage":"https://github.com/gnzcode/blubox#readme","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-zDPA9f0Dn/051XFpOl8nsSRf7EWO1nw26vbibhNy5AYA8ILXlgWI+UlX/h3x1wkX/Y7bkosDvvrOh3MwFr78Hw==","shasum":"cf0cd40dc0ed0b59c97aee5191fd46dc94dfbd10","tarball":"https://registry.npmjs.org/@blubox/gateway/-/gateway-0.0.2.tgz","fileCount":6,"unpackedSize":6541,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0kNkOtxl1Xr5OtZs87TKwEvxDVS5yWOLZA9kCMPO2pgIhAMWPA55rZu60+wlzPGiuF9dRkxLGoG7364EsIg22Xcyy"}]},"_npmUser":{"name":"gnzcode","email":"gnzcode@gmail.com"},"directories":{},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gateway_0.0.2_1697395269390_0.6095581462386761"},"_hasShrinkwrap":false},"0.0.3":{"name":"@blubox/gateway","version":"0.0.3","description":"Blubox Gateway","main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"private":false,"publishConfig":{"access":"public"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"license":"MIT","keywords":["gateway","blubox-gateway","blubox","@blubox/gateway"],"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --minify terser","prepublishOnly":"npm run build"},"devDependencies":{"terser":"^5.21.0","tsup":"^7.2.0","typescript":"^5.2.2"},"peerDependencies":{"blubox":">=0.1.0"},"dependencies":{"axios":"^1.5.1","normalize-url":"^4.5.1"},"_id":"@blubox/gateway@0.0.3","gitHead":"f53ad493f47a033ef0c0b9c9fb0aace5275c4d30","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"homepage":"https://github.com/gnzcode/blubox#readme","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-B7N9FOaDBlQ+zvBNTQYbTjdL/hYKASN25+IwkTYmZTheNDJ9kvwXzysbApU22U7eg42oCMRHwMYsyk2RPxg3kg==","shasum":"f5077ce97856e131c2a5c7c5ec674581452a2268","tarball":"https://registry.npmjs.org/@blubox/gateway/-/gateway-0.0.3.tgz","fileCount":6,"unpackedSize":7043,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAtkXMWjnUjIPTBwC0PF06lBS9vDTmVtAKd+eHppbQqLAiEA+NC02KLZPBFTdRwM++DOdIvbaDU2R3k0mjU+u7+L5eE="}]},"_npmUser":{"name":"gnzcode","email":"gnzcode@gmail.com"},"directories":{},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gateway_0.0.3_1697505339063_0.8091627950133053"},"_hasShrinkwrap":false},"0.0.4":{"name":"@blubox/gateway","version":"0.0.4","description":"Blubox Gateway","main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"private":false,"publishConfig":{"access":"public"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"license":"MIT","keywords":["gateway","blubox-gateway","blubox","@blubox/gateway"],"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --minify terser","prepublishOnly":"npm run build"},"devDependencies":{"terser":"^5.21.0","tsup":"^7.2.0","typescript":"^5.2.2"},"peerDependencies":{"blubox":">=0.2.0"},"dependencies":{"axios":"^1.5.1","normalize-url":"^4.5.1"},"_id":"@blubox/gateway@0.0.4","gitHead":"62a948f3a3f7657964287bbf20c3596b38d68d32","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"homepage":"https://github.com/gnzcode/blubox#readme","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-4lgLSFOXplFcxiX9jDOBalPh5wYKn3NtZ3v0HCp8YIsyq3cyKvLWXw+kbYGns7aQ/p7/6YC2MsAJQK8uNl5XGw==","shasum":"1ed59b765f95c83c9675bcc4ffa46867ce188904","tarball":"https://registry.npmjs.org/@blubox/gateway/-/gateway-0.0.4.tgz","fileCount":6,"unpackedSize":6971,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH3L+0cA84FMh2K6K2o4+DkzOElm4D3e9YFb62m9l6RBAiEA1nf8GYfm7cDHJmBN7Fr3hvH8rrjfW9sGbfs2Scb6O3A="}]},"_npmUser":{"name":"gnzcode","email":"gnzcode@gmail.com"},"directories":{},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gateway_0.0.4_1698264948954_0.08010376311972989"},"_hasShrinkwrap":false},"0.0.5":{"name":"@blubox/gateway","version":"0.0.5","description":"Blubox Gateway","main":"./dist/index.js","module":"./dist/index.mjs","repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"private":false,"publishConfig":{"access":"public"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"license":"MIT","keywords":["gateway","blubox-gateway","blubox","@blubox/gateway"],"scripts":{"dev":"tsup src/index.ts --format cjs,esm --dts --watch","build":"tsup src/index.ts --format cjs,esm --dts --minify terser","prepublishOnly":"npm run build"},"devDependencies":{"terser":"^5.21.0","tsup":"^7.2.0","typescript":"^5.2.2"},"peerDependencies":{"blubox":">=0.2.0"},"dependencies":{"axios":"^1.5.1","normalize-url":"^4.5.1"},"_id":"@blubox/gateway@0.0.5","gitHead":"84d558115d2665f7a4a6a78316518461fe34a254","types":"./dist/index.d.ts","bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"homepage":"https://github.com/gnzcode/blubox#readme","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-IUgoMnWqe1WxhbdjlGqT163Slj6v8lCQm7XbR9QdwRjHbnQIM0DmRjyprmIyzL/vcvGzmGjG3yJFH5p1fixZtg==","shasum":"efa02cdb5bd2a00df71acf952977431d514e9168","tarball":"https://registry.npmjs.org/@blubox/gateway/-/gateway-0.0.5.tgz","fileCount":6,"unpackedSize":7021,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1zQi0oV+LazvQWnsCpIC6u1OXsoAd3fcDyE54vkGy2QIhALALqa8yupYpT2lsi8PSSuVGTifOFVrinksVEGFjmW7L"}]},"_npmUser":{"name":"gnzcode","email":"gnzcode@gmail.com"},"directories":{},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gateway_0.0.5_1698350927837_0.19279805519144544"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-15T01:49:46.216Z","0.0.1":"2023-10-15T01:49:46.553Z","modified":"2023-10-26T20:08:48.246Z","0.0.2":"2023-10-15T18:41:09.668Z","0.0.3":"2023-10-17T01:15:39.278Z","0.0.4":"2023-10-25T20:15:49.195Z","0.0.5":"2023-10-26T20:08:48.031Z"},"maintainers":[{"name":"gnzcode","email":"gnzcode@gmail.com"}],"description":"Blubox Gateway","homepage":"https://github.com/gnzcode/blubox#readme","keywords":["gateway","blubox-gateway","blubox","@blubox/gateway"],"repository":{"type":"git","url":"git+https://github.com/gnzcode/blubox.git"},"author":{"name":"Gnzcode","email":"contact@gnzcode.com"},"bugs":{"url":"https://github.com/gnzcode/blubox/issues"},"license":"MIT","readme":"# @blubox/gateway\r\n\r\n> Blubox API Gateway\r\n\r\n### Installation\r\n\r\n```bash\r\nnpm i @blubox/gateway\r\n```\r\n\r\n### Quick start\r\n\r\nInstall dependencies\r\n\r\n```bash\r\nnpm install blubox @blubox/gateway\r\n```\r\n\r\nCreate a Blubox application with Gateway\r\n\r\n```js\r\nconst { router, App } = require('blubox')\r\nconst gateway = require('@blubox/gateway')\r\n\r\nconst app = new App(\r\n\trouter({\r\n\t\t'*': gateway([\r\n\t\t\t{ from: '/users', to: 'http://localhost:3001/', replace: '/users' },\r\n\t\t\t{ from: '/items', to: 'http://localhost:3002/', replace: '/items' },\r\n\t\t]),\r\n\t})\r\n)\r\napp.listen(3000)\r\n```\r\n\r\n### gateway(options)\r\n\r\n```js\r\n/**\r\n * CORS OPTIONS\r\n *\r\n * @param {Object} [options]\r\n *  - {String|Function(url) => boolean} \"from\" where the request should come from to be redirected.\r\n *  - {String|Function(url) => string} \"replace\" which must be replaced from the pathname before being redirected. (optional)\r\n * @return {Function} gateway controller\r\n *\r\n */\r\n```\r\n\r\n### gateway(options, controller)\r\n\r\nYou can optionally set a custom controller.\r\n\r\n```js\r\nconst { Controller } = require('blubox')\r\nconst controller = new Controller()\r\ngateway({ ...options }, controller)\r\n```\r\n\r\n### License\r\n\r\n[MIT](https://github.com/gnzcode/blubox/blob/main/LICENSE.md)\r\n","readmeFilename":"README.md"}