{"_id":"@atlas.js/koa","_rev":"35-7dd9f98333985fd324b0db6255c34ce7","name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","dist-tags":{"latest":"3.3.0","next":"3.2.0-alpha.9"},"versions":{"0.0.2":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"0.0.2","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.0.2","@atlas.js/hook":"^0.0.2","@atlas.js/service":"^0.0.2","babel-runtime":"^6.23.0","koa":"^2.3.0","local-scope":"^1.2.0"},"devDependencies":{"@atlas.js/application":"^0.0.2"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@0.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.1.4","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-MnmFoEnRwppuBEsD+UmwmpCFUQynZiUYLFWEFMc3SCSB6RF6QbSCvzKTsPAUj0nijmT0gEKePTBQZKf+F+nhrg==","shasum":"3361cbb1bb47d8b12279062de3527b961a0717b3","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-0.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmBl5VEfY0CsiZpGwiF+v2042uxAVFMxyial65nAcZwAiEA8I2V6oEmRDM682BGEaeEm3igNkMIyMyTcU+2iKzNYQo="}]},"maintainers":[{"name":"robertrossmann","email":"robert.rossmann@strv.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-0.0.2.tgz_1502384085013_0.7840578728355467"},"directories":{}},"0.1.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"0.1.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.0.2","@atlas.js/hook":"^0.0.2","@atlas.js/service":"^0.0.2","babel-runtime":"^6.23.0","koa":"^2.3.0","local-scope":"^1.2.0"},"devDependencies":{"@atlas.js/application":"^0.1.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@0.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-s0HTqvC2v4i4Pa5VOSCr0nON+J4FG5ejQVoJCUXL9sWcQgpYV22CTU3CZpCWFCvQ4ORUpGcROpgCxeOFsnquow==","shasum":"8a66632251f53072391c89104bc602dda4868f05","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDWTXWJZaGeQeF/o+OPkh92x6BR4NfvQ3Nna4JRMsh3iAiA6MHrLLtdtySDhdKZuaNbpoxavFxxbn9fn+CGXfY3uQg=="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-0.1.0.tgz_1502872971286_0.6666836198419333"},"directories":{}},"0.2.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"0.2.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.0.2","@atlas.js/hook":"^0.0.2","@atlas.js/service":"^0.0.2","babel-runtime":"^6.23.0","koa":"^2.3.0","local-scope":"^1.2.0"},"devDependencies":{"@atlas.js/application":"^0.1.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@0.2.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-al9eeq7H7LgnVXO/rtArHJUxTx332FI49iqy79Bt1c+p3OxE7B6wrWq7r5TZwDyCJTMMnqGAMjo95JCU1Ix17A==","shasum":"0c9fcb68ee996062bccd6851ff59c3ff4f0c6f33","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMhTByDgX6YXeO6ivSHz/nrJG81bx2dz3ji81FqAon8gIhAIhaixknOGb78iP70kMFZy9VBvHA+wu85JVg/asMdrQF"}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-0.2.0.tgz_1502891728431_0.2280802819877863"},"directories":{}},"0.2.1":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"0.2.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.0.3","@atlas.js/hook":"^0.0.3","@atlas.js/service":"^0.0.3","babel-runtime":"^6.23.0","koa":"^2.3.0","local-scope":"^1.2.0"},"devDependencies":{"@atlas.js/application":"^0.1.1"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@0.2.1","_npmVersion":"5.4.0","_nodeVersion":"8.4.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-13R2/jxOKKuI+u9M6iqEhGQXlBsatldIi54r/oDfwyfxi4b8FHSCyE3P91Aj8fupJXYkEgGCQ0ShLDWswtDu9A==","shasum":"e15e45fcefbe6503f6813b55641e806cfac8ece8","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-0.2.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiFX7ZSFaRUlE3dQNKZjJUO/GujuJGMl+pQTeINwgvswIgKRtkarVi/b55aMauqaLrPLgZtW11S94UaEi8Lnkp9FE="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-0.2.1.tgz_1504355311718_0.7205425465945154"},"directories":{}},"0.3.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"0.3.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.0.3","@atlas.js/hook":"^0.0.3","@atlas.js/service":"^0.0.3","babel-runtime":"^6.23.0","koa":"^2.3.0","local-scope":"^1.2.0"},"devDependencies":{"@atlas.js/application":"^0.1.2"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@0.3.0","_npmVersion":"5.4.0","_nodeVersion":"8.4.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-2VyqoMdu2yJmRsz9mhfF2qZeW85Vq82vJwQKBV+rJGRRQpx4juXQQoghY+JleNfGfuYK0dTrD1a4+c+0Rw64+g==","shasum":"302b4a97487aaa5dacd06d4b5d977335e8851d70","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-0.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF1HFuxe2E12cefrJsI6zzPXxEvkalUSz2ifU2jVAoRtAiEAkCaiaiD8W5UeXnc6VSMghFn7aAtgkbnXrmkX1BBdeBk="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-0.3.0.tgz_1504629725332_0.047602715669199824"},"directories":{}},"0.3.1":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"0.3.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.0.3","@atlas.js/hook":"^0.0.3","@atlas.js/service":"^0.0.3","babel-runtime":"^6.23.0","koa":"^2.3.0","local-scope":"^1.2.0"},"devDependencies":{"@atlas.js/application":"^0.1.3"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@0.3.1","_npmVersion":"5.4.0","_nodeVersion":"8.4.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-1m7iY+2UUK50Xnv1IUnYgUSU58DWsfuBj8almuXHSJYPydsnQW53cZ8UbVsWDMlaPnsvWY9mVeErh7brFfi/hA==","shasum":"4e1030952e8d3832a6c67ccb1a20ad88bb3d55c2","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-0.3.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG2XtkVQuojmHp2x29hYxen+hrp9WOtSjgkMmazePOiMAiEAvFlk6FaPlzjErzoGyz2MDF5MLdw3jIfD4000fzBsBRM="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-0.3.1.tgz_1504652609910_0.8112315684556961"},"directories":{}},"0.3.2":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"0.3.2","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.0.3","@atlas.js/hook":"^0.0.3","@atlas.js/service":"^0.0.3","babel-runtime":"^6.23.0","koa":"^2.3.0","local-scope":"^1.2.0"},"devDependencies":{"@atlas.js/application":"^0.1.4"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@0.3.2","_npmVersion":"5.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-wirhmg+VRBQ4Fbt0P7enMag6yLar2tPZuKh/nuGSMCc+I66BsMP9mcuIgnKgbBZ3JB7ESBS/Tak3J/ILqILJpQ==","shasum":"0d0eeb778781288e5b1ce8552721bf60fd841e10","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-0.3.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMAcnX7QR/a7AAX/eGq5vcifNwr0OKjNsk8mqgU0NslgIhALFLGyeQfvwtuFzZWVUiOIJB0ieMVYLiNuM3mnpiaKz4"}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-0.3.2.tgz_1504800047167_0.911689321976155"},"directories":{}},"0.3.3":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"0.3.3","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.0.4","@atlas.js/hook":"^0.0.4","@atlas.js/service":"^0.0.4","koa":"^2.3.0","local-scope":"^1.2.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@0.3.3","_npmVersion":"5.4.2","_nodeVersion":"8.5.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-Xk3dVU4266opEQMZyTZNwkfOnKjhWoVwA08f3kc5/C7eLmGlKqdaz+I/WhWDLhgAJsX0FU3PzKsaCz6wpH0Caw==","shasum":"4402ae3601cfe05dea51b161976c8731c8f5dab7","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-0.3.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA718JH5aIaNxdE5iyg2VnCV7TJPjKMAReY/kIftXFZbAiEAg0JmP+jb+XbJ0vqDfSPUd5ePi4+klB3itLizzATvoio="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-0.3.3.tgz_1506067621608_0.0748759931884706"},"directories":{}},"0.4.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"0.4.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.0.4","@atlas.js/hook":"^0.0.4","@atlas.js/service":"^0.0.4","koa":"^2.3.0","local-scope":"^1.2.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@0.4.0","_npmVersion":"5.4.2","_nodeVersion":"8.5.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-KWVy3j/6Evr9azjfwxwQR4H3Q1il2aa+yZkz1R7t9UKX5ldNsGBBJsd2Yj7CMhJiufxQA4mA6uaBKWAPBzhlzw==","shasum":"9092a04846f5aaad94829e456fff9bcab4f34b09","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-0.4.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDYzOfw+PKPQA690Np6PPQ2gmjuwPxREskJFf36WoFfwIgbG2mdeCLw5OYgzmovITU29mY0mevqm2D1+hsLNPI4hg="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-0.4.0.tgz_1506425704374_0.5554228939581662"},"directories":{}},"0.5.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"0.5.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.1.0","@atlas.js/hook":"^0.1.0","@atlas.js/service":"^0.1.0","koa":"^2.3.0","local-scope":"^1.2.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@0.5.0","_npmVersion":"5.4.2","_nodeVersion":"8.6.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-Wq2rZ3tOHe+TadTz92MDdswfiDPIAuJP3MxgMRSuKU6lgke8dreTabW1OIVMgBxRnLCPlj3uLpDHiQkoMyVXqA==","shasum":"26552581d09eb349f9550182e859fb89d0728761","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-0.5.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH/bMxYT09xKy11V09/ZMkodDMAGYhv8ngkiNLOTkrA1AiEA+qBPzbrZUxi99tS7es4HXKMiRZZfkRlGoPMDmEP+sOo="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-0.5.0.tgz_1506502228977_0.6735596847720444"},"directories":{}},"1.0.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"1.0.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.1.0","@atlas.js/hook":"^1.0.0","@atlas.js/service":"^1.0.0","koa":"^2.3.0","local-scope":"^1.2.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.7.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-6nvo7ugL1NRYVEkUW2tRWzLa/osl8Rb+RfLBJw1mNK1LAXn51LuJf8gdTKM5KMfkihprEGxQamDpWGCBw6/8sQ==","shasum":"2f53447e0a83aefa6eda5bd5abc1f44896a2f443","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCeQwL4Ulh3GTIXVcrn3/seBdfcYy/vqjq/HDSwnxjlAIgJkmwsTf+jXdtmROuSkImnuFBR3W3wk9vKPBYUTLMMVE="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-1.0.0.tgz_1508878109482_0.28895187145099044"},"directories":{}},"1.1.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"1.1.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.1.0","@atlas.js/hook":"^1.0.0","@atlas.js/service":"^1.0.0","koa":"^2.3.0","local-scope":"^1.2.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-vzo2XFRWWditvnmq7iKGDKCzrzRVaesaHsyCMkPr8pUs79CfPu4h48mSju/OH9bOZ2SXmSdzTho+BKdx0or+YQ==","shasum":"cbbb98c3bfbabc17899d38e41c7f996b981f0a66","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJAhPcZqNZK5Hz4rWGgeOxG9902ELKlUG0yzGdVTRc1QIgRXeY2kqbQDxTYKg3TMsVAUqNlrD+RGRuCKwvM0LeMdY="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-1.1.0.tgz_1511258416089_0.832183685619384"},"directories":{}},"1.1.1":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"1.1.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.1.1","@atlas.js/hook":"^1.0.1","@atlas.js/service":"^1.0.1","koa":"^2.3.0","local-scope":"^1.2.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@1.1.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-p3P7VZYdHe1TpfX0Wx2c8ArM2CzwnZ1veqsr5g/hHyD+nm1drFJUewy4X7qDcuf8m1YFydLjyE89jxC/vRWtEA==","shasum":"26df6a175d8a89ab73221d1a6818d833025fc999","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-1.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAP+LxKX5BPEP1EnuXLRDNAfq9OJN5QUIAOq35czmeCZAiEA8c4nL0/5291bzBHEg+hTSXMvexKOF+nfoHEC6kkOH1A="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-1.1.1.tgz_1511776463288_0.9191491522360593"},"directories":{}},"1.2.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"1.2.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.1.1","@atlas.js/hook":"^1.0.2","@atlas.js/service":"^1.0.2","koa":"^2.3.0","local-scope":"^1.2.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@1.2.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-xpijpLLWrbrJK3YBmi8PAc624KO/YS5ceKZ3JKJKD5tM+vMqYe9mF2XkHQ0+VnBm7q2dBfiWQLlPQVzGaPPdCQ==","shasum":"31927cb2ad566434f60a5956fa7180d48dced606","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-1.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGQafvZBHv5B0U26MV7xW/+/8q9sLlOHAmlCCg2USvNCAiBnccnPUGbenYhfG2drfUJzaRchv5CI00Da7YgUy9Q00w=="}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-1.2.0.tgz_1513166192756_0.38392187748104334"},"directories":{}},"2.0.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"2.0.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.1.1","@atlas.js/hook":"^1.0.2","@atlas.js/service":"^1.0.2","koa":"^2.3.0","koa-websocket":"^4.1.0"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-n9Lt4e2SVQFmqNubS8jW5mZNDheQNTncXbodd7Oli2LLU3QScXSnHU+TBobUXaXs6D0Ce9ZM3yLjU/fFXecQkg==","shasum":"77b01f43ea36c33a9fb8f16a17a9f8293525b6fd","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-2.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5zwJ+JbxbIfDs0nw2QCk7gZbibMxqvxt4d64elzwyfQIhAJnRiJiWCBNDw2YmVwfu4gcDU2OlZJpKWSdG9xLc9w0h"}]},"maintainers":[{"email":"licenses@strv.com","name":"strvuser"},{"email":"robert.rossmann@strv.com","name":"robertrossmann"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-2.0.0.tgz_1516271209639_0.43110036640428007"},"directories":{}},"2.1.0-alpha.a596c671":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"2.1.0-alpha.a596c671","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.2.0-alpha.a596c671","@atlas.js/hook":"^1.1.0-alpha.a596c671","@atlas.js/service":"^1.1.0-alpha.a596c671","koa":"^2.3.0","koa-websocket":"^4.1.0"},"devDependencies":{"@atlas.js/atlas":"^1.4.0-alpha.a596c671"},"engines":{"node":"^8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Service)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Service)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@2.1.0-alpha.a596c671","_npmVersion":"6.0.1","_nodeVersion":"8.11.1","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-w2Rt2TiAiOu4+AezvErYLx4UYhTMWcbR7Ap0GYZJW6KWQFIOcQbooQ3wHq6+Y3hvs6xLxcPYjn4zcfGI1aZb9Q==","shasum":"30bc68395c3dc06df26db6ec480fe0e18cc37f6d","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-2.1.0-alpha.a596c671.tgz","fileCount":32,"unpackedSize":113265,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+aTICRA9TVsSAnZWagAAtdMP/2Oe0L9lWI/7Fm/hBZ01\n9JNpVBCUdfklo0Srum6ZUAvQyGvz5YIcNFTZW32t2I7gokJWL6GhFwDj3U6z\nwmmVi79HE/c3J+spigDKgcCyRlD5MErKCPNPAcMaUdGw5s1xTuPAYijvywwc\nditbFN/+vKeBtrRDJwBCTXWFlRKOHcMhp87KZ8Z8WS83DjeO1P2CT9GtC8HL\n0rlKlX1WvOC71c+4RqWjs4pym3h/zLSQ5+7t9WYw1JpgZlWkJX4I84DWUET7\n84HdMtfa+hUD6lj0Dz8cOL29bSWaulJbm6+9Vrx7zOAopRM7ZOwGsJgiXObc\nGwC6cDa8VEju/3tcqhpdZ+hwrpDNxrjVF5PtbSEGeo2WcdQjCAEfRKFwieui\ngfkGsk9ii1rqlTI4wz2fASbu0TxpsoJeIrl+ia22wYc4dtodsXP+Wkx9slVW\nYveBwD0DVKdCiRf/40hxpyDWU1VLc2907g8R9M7sTcazTERycwfiXsRUi0T1\ndSr/qCk20Iu6g8l2yX0Sscji9yWxKPyL9yjuJesBiTJ3fn3KcxcpB4dyoCRb\nJsq0xwtTIOIj1H1ZAB7QsHzZJBKhPZekt/CIFPrYHtLzNUR9msTLa+0lByOc\nIesavqeI09TJgtNvsPSP4+ZYCIOSzMmO+optUGIKrhuBtsD3bKBEdaAIqGK6\nhSTc\r\n=P7GX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAcuJFeufYAVYeIx1jUrm9cB1tQnIGYhqDcKimYDfu5BAiEAthplhY3Ay8aOUje5FR0eVhrg/E5NM88FYdpIkQSbdt8="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_2.1.0-alpha.a596c671_1526310088192_0.470116018694668"},"_hasShrinkwrap":false},"3.0.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.0.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.2.0","@atlas.js/hook":"^2.0.0","@atlas.js/service":"^1.1.0","koa":"^2.3.0","koa-websocket":"^4.1.0"},"devDependencies":{"@atlas.js/atlas":"^2.0.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Service)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Service)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@3.0.0","_npmVersion":"6.0.1","_nodeVersion":"10.1.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-enibcVrVllTn8SATHJRDfKXlsK2fzOFRSI18iVUW8aQJ7exr+x6lhrXDdAyBzT1GcQLJqMjXvR6a/vI1oIwNdQ==","shasum":"5bbcad2f5d19e76365e4dd0850325815e592c54c","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.0.0.tgz","fileCount":32,"unpackedSize":113268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbBDkdCRA9TVsSAnZWagAA6rEP+wcEILrN/00LR5DBPW0J\nhWRcQmvOX2X91WL2RM8yvF9k8CAAFT6Qw2TbmNKHa/WPoJG2QOs/qO6ty88T\nDmr/4BdEF9v3jcpqzbvMuIyhUTfy9gPlDOJf2JjOLRlsRYUhjkyMfQOohCrL\n1gfq4mHt72T/zAFNSO2cCHg1OsCKRLePcPTUf4BR+3NBdUPmLPLJg8ONQ8Hf\nszbGtYVPEZRX/1tYzq4lxv1L7+7TTHqFh/WHCbHbIJ5PSBRi0ddf8h0+jpPR\ndFF6h7TYZqSm1sTWVNda35J/OE0qX84ekFfI5uv/lqYVGJNMUFSwoJWNrRxH\nr9I/hHL9XtJs8GWh3FFY5+0nbAV4y/UCxCsB7vQhN+tKeslGo0TsenCk/i07\nDLhTHLiCSmv51tkq+kI99aqfgQj0KibOZUQyEGsu+sFPdSpWhnJxApTwxHsi\nb4VZPf0+MJM+8DCEOXCkw/4xis9MLzC2bUf+gH2RL3aLbJYXJG3z7yXQCOO4\nTNgR2OrO0b0HDU55bUGoaQohv7ix9eVAgFJhr/yaRkxoT7CyDN9afBxPPf35\nO03FREILPdRH0j9EqtHLSyHAWyfciQhohr78XF6J2a/iPtHi5D324Uo8ZWCK\na7lCbLCf/5/uaE9VPJb5uVJndyh3Fsgr+Bqof3lnSnCwaNzV+18JPp/hYNZz\nhL3B\r\n=Q6hJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKtUDj+pDEVzOKdSvIS2FpFS4wPyZbbpZYovRljLXfVQIgNTyjD9d9EwY9JeGe6sAOVf/C6IxtOWJ6GwNJUwrVn6w="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.0.0_1527003421179_0.566230622903936"},"_hasShrinkwrap":false},"3.1.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.1.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.2.1","@atlas.js/hook":"^2.0.1","@atlas.js/service":"^1.1.1","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.1.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@3.1.0","_npmVersion":"6.1.0","_nodeVersion":"10.6.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-fM+/O72FP4jPKsEG3ZXfU++1N8gh56NoVY4T/ikYbh2YkOUZ2KoiZUm8X+Ev6ZXzIfTaD+g2Rp3qCIfoB24Vjw==","shasum":"dbf41336907f13fc4abc2574d2974e9a1bcbba05","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.1.0.tgz","fileCount":32,"unpackedSize":115956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbR0oqCRA9TVsSAnZWagAAK8QQAKUkLRSjRkmJfQhpvfyQ\nrJHmwL8ag4SbIJLeWCcFyMKLVB2I4KAwv5V1DmdIneEZdrNrh614PmmKpwJ/\nOgN/qJLVqudovJ8YmDTNF6HVA5Almz4cC02UFQ+Nijxe7NpE+yRZlquCE2RZ\nORwBjKr4IXplfLik5ZZcjzy47cnoUmPs3SVuDNbG5VTzl6Ud1nkvXdkDMJVJ\nanG5WHa4hds1W5bJ33fiVhYmd2h4KTBc0WQHtF5LV9EOOFIBlbgp2kQY++Lj\n9729tma2gDXGAI03V3qbnOSm8y8WwCkxYZW9LfRoPPyVJxG7+sw7Fuxd+eP4\n1RaCrJugU9plC3ctPbuNTtaaJm6vBwZqEQ4Il0ZXKBjdUqr2ZIIQOsG7atYe\njAdx/dXhS2eUd1D+o0x+ziexKGeboYKmAuROYHMEV4E1BBrj7wCRyc08nGvo\nZChtF72lxrl9xEpy1/mlNkllieqDmyleYiKBoJrB3HHclxVxu/fQxO47lCy/\nRWkJJ9yMZqOEeGR6clOA3R3VOXiJZL2biM8hKRg+NAdtV/GDpRkO/ktslsO4\n+KnWahjhvj0c+01XUR2J4J3iumDTfZTg+4d8SJD+WeiU9tFKCwN6d7R+KRIa\n1onyxhBqj2kK/yL3CiNe15J9mMxS6DXM+Olm50goiJvWa2NPvo1mJs0Aq52E\nhDPy\r\n=ZifG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZQen+c4JdyJic69LoFi+96u3ae4kCm7Bgjtg4RkJONwIgSGTDgXBFjeR22zCJN1i32QKYTJEmOE6f0VYhec6WznA="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.1.0_1531398698815_0.5234179510417587"},"_hasShrinkwrap":false},"3.1.1":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.1.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.2.1","@atlas.js/hook":"^2.0.1","@atlas.js/service":"^1.1.1","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.1.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"_id":"@atlas.js/koa@3.1.1","_npmVersion":"6.2.0","_nodeVersion":"10.6.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-aL1o9PxQ4pXqycLg2ab2pyXpZt78bQEBjEuVkzet2Lop1xqwxQ7XBS/xHCr+fqUjhp/zNj8VHoNfxL5/Tyx01w==","shasum":"0338b3dce2d4e40fc8c25d0c678ba8e78b5df1b8","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.1.1.tgz","fileCount":32,"unpackedSize":116376,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbTDJQCRA9TVsSAnZWagAAnYAQAJPrmnEDzyOPn31+10Mk\nqQw6LBP1zmXzpgmnwgkiTUygePhAptqmcc5zntyl142spbvy/YwxpMq06Cff\nNMI4j/To7246MP1Q29Ma94bmYj+Jk12BddW4WkptgA4IwS8kBSEcOmn1vpT1\ngphD1hGe7bqbcD9zRpgsiHKiJhXPUpmi9wLGQ7U6h+RM0R8xcXmLyv8H+hPm\nXUe17GO/cftPxAIFU4xRG42yKnlxqDXEf95GttLhnayzapC2wvMldH7qyYty\nmLOThllFwJ59T06oLMLdZTvRmWEtUZhvA/CFbkfUbJnjQ29LCHfxi9w7mIgz\nPaSYmjQwqeaK+q/pYoU6erq1jVDt/Pn7AXcwgxk9BJ+zt/Av7s0xCoRC5UOb\nOkfoyEHWZnC4ml5aO68tGMxm9QSxp1P921C2MzoeEMLmwc/Olh60JPQCmIrg\nWold+texIinoABl/F426w7dleCmxA18tXih2Tt7y2L7+VcAJmE0W59fyxuqI\nlZPbAw9tPc6cRwC435PpjYHiQUNjEVFSNPo9JvIGh4qgrm1NAisu1CictmEU\nm/43J3JC8AicAPFAXoujeZMDqP2lbDgRrwP3fYrY9r59EJUDXen3z9q6zWD4\nOfG32Fv7OTfAZebr7TElodJQZNBJtFQ0u7/vcz9LgImaQ7TwI7qMtYQv6hwd\nzxRE\r\n=GeH+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpuq3ylpJ3HD0KhxVkhwA2DE1JNkS/ZB3vdsbT7D165wIhAIu3+BoqkUX8ms7OGhvacZEb1Qr/12JqJIpWnsm8bAd2"}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.1.1_1531720272247_0.5931925475341431"},"_hasShrinkwrap":false},"3.2.0-alpha.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0-alpha.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/hook":"^2.1.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"8b6af27b5ca8e64ba5dffa05e92c01d804dbf6f1","_resolved":"","_integrity":"","_from":"file:atlas.js-koa-3.2.0-alpha.0.tgz","readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Server)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Server)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@3.2.0-alpha.0","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-shieODhABcDQSxDtT/U2iIsLHbA6uUIYJwe3RCvp2xdBVzXoaI8EiC5hyup9f/xevq/r6Po2BtMTNLrsO+rUIw==","shasum":"bbaf86bd38d173192e111384f70990a902dba515","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0-alpha.0.tgz","fileCount":36,"unpackedSize":129459,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCnM1CRA9TVsSAnZWagAAiZMP/jM75UD/tBZF++wdMHYb\n0nS96nZdzUiSPbMV12qpfkqxkSMftyYVIAzq9SLN7rRkszArGyRSN0PFvA2M\n3Njwa8DXeywdYPdBpvxKcHcmdkE5K/SZZg9mpxQ1lCiToxFl9EuEBLwdygYa\ntCRK1GlY8OcIzyyF/lLswkGLrr9tIwbQnhu9uPApynUZMTHKW+81IUq3bs9Z\nKO4j6nXFtROncnpZGuRXts9LMvfytTXNv60f5OQKRO6VdTBV6qZikM1eCKTv\nyh2XSi9GJ4B9dLHv7TNE+XhyE2fu+0ch1r/AWLjDuK+/MxjDB4R5VJDqy94V\nGF0dfFllYkkGCmLdbKtjlcXPLx37slMkNPm4saDslZM2ocLt1I4NzbkK4lWL\nEczoNvy1qRqYNkA0WKvuFALYqvy21GjBA3bhsfhRkSW9txo/tN7Z4zEtFE95\nR9IDJyqZ14vMGQfuGBRc/6YFob422IZEqCMnhHbD0GHkUJpS6FvcWBXkrivM\n/FbKr0aZsG00QNifiVxTCzLi3ezQ+KphnFt/LNv+FZ434QuA2fqE7JpwfCad\n8rXbo9XQ2RVwvLkXdNZA9z1TPWSrGpfksoIkWJYMETroUAa7XN6P8mv7Iuxy\n3g8GWOq0EtRiLxle0CQvQLrrwsDt2il4dX2MXEBNDyfQr7Chs+Qog5tW8I07\nm7ws\r\n=IqWR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6UJz88MjWP6LRSfDvfwg5RcRIeeIHMOzj/qYcz2ac/QIgbeJiir5kZe5/8aZ1jxhjhUgNBWD9wxcAoFkVgoRBiJM="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0-alpha.0_1544188724804_0.07332994636609502"},"_hasShrinkwrap":false},"3.2.0-alpha.1":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0-alpha.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/hook":"^2.1.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.1"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"e58999d8f2eee67c5e5e0f079f273f65ee9932fa","_resolved":"","_integrity":"","_from":"file:atlas.js-koa-3.2.0-alpha.1.tgz","readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Server)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Server)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@3.2.0-alpha.1","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-rhJqVAoGntAkEpLGftC6BTsw0xOdQD7H3TvmmH16FsAh/9wEkiIdVDCrueY8v3viYAcAcz22pQnQid5SsMhqsA==","shasum":"fdb8a2a29b78ce25360c0c2d7eb2283a9bc5e6b1","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0-alpha.1.tgz","fileCount":36,"unpackedSize":129450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDi1fCRA9TVsSAnZWagAAJrAP/A+7M3/VCGV99AJ2cUUS\nlE/pKG7x3ub8LNMDVeatxSri5FJtmaXacqcSdsrPs6awTVpugFmWBKfXYDRr\ncIDiyvnjzngEleFRxTfqx85BevUFXXgQbcNwAqubsstDYxYqjfIMYc+BdQZK\nwXaNqqLdbSYd/rEpqH+3+UMxPjnQwD2i4f9HdQHUZ4GS76OQpNwhIXsZ1kqF\njWvLFzYNZapcNPdfPQzrN7UVcZUfleKy/TsRlKwNXqcEryXwTKZZEUdwxiGR\nwwJSSDg1lFXtghE9g/m/1VVMH78lMoFzVeZZXBDBo9cht+YhG4cdNq9kGMnf\nOmo+Q7griE38n2M2jkDs0P95qpUTRz0nlS3BdTh1B9xNfwoWc6SXkloiPVTm\njoxc32CSK6g+JkFUjICtbVn5KpT5HoUQ9TwbOvLeWVVQq3yNcG/86ZD3Mb9Y\nd/usaZDT9lRTje+0SSpzrRumGbuFYwq9RyYq3Jol1uzruUbqHsZrCiZymHOL\nvQbu8ns2XRQuIxvWkObOFWcWwNNy2yb8pEgjXTI0cm/z1CKtz7l5tph7rr3G\n5zQysUnewso0UVqf0f2EiPwtfw9TsCn2w9njHaH99C0ytZ1Ktlkp9od7I42z\n2GpS5oO5TJYcfcvWdP82tVUBRGKYcjmr3eXx1ksIc81huz8aHP43da/eiggH\noO3e\r\n=CFQ7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDek/puaCJJhQQLVxvIlcoJVT/DYDqXo8zJ4ajLw6QtjwIhAM6zN8BUfBiaUO592jQyxvPdsB6FTNByjhKMgBzApM5I"}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0-alpha.1_1544432991352_0.49877430953729984"},"_hasShrinkwrap":false},"3.2.0-alpha.2":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0-alpha.2","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/hook":"^2.1.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.1"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"63f310da00ce969d92f1547d7635e09a56dd57fb","_resolved":"","_integrity":"","_from":"file:atlas.js-koa-3.2.0-alpha.2.tgz","readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Server)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Server)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@3.2.0-alpha.2","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-a7FURFffpvgyW4DEcCtKA3e8Z7576HFnr1b8oDkJScgUtpOL1Jl1eHh0q2YdZdDJBO9gRM76gEIdmLBElvEuNQ==","shasum":"81665319fc6d143f0fcad7079c02a791bca0eede","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0-alpha.2.tgz","fileCount":36,"unpackedSize":129870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD3sxCRA9TVsSAnZWagAARm4P/iO2HNKZ1mHIC6s7m86L\nZ2VVWeJbxU3Da19zj3dfkceoMfYjiWMfQQxd7wQaFwpI28790UMdxfVUIhKR\nlnhBAMbN+ZAkSPknk9bl8MwsU3DNeqC5ol1QJHzxJp3tp9495Nn2yZZ2Er1y\nVgd9oRDYjd81V8TZTeyoASWykq2MQv21+TXxrFsTojTRpS9a/KfILMLumyOX\nYjQgvA7dedaZBVYMR4BRekyvUOtelDGYS3Qp7ewIgJK6fbcz1yEqnVdGqnpW\n9e59ScRzoDmLafPxeZE+27zYZ7UvRcIIcjM5Y7UDxM74VJ2TiH5DPD+8MQRO\nWJX3fSE2cyVTCNybvjbNZfKbxumhg8CfDvSPe7ZgEj7q108vjSYdMdWNdYN4\nY+sfoYykQtpwbJ44njZDejr1GkeYQOtEYbt2go1JmTDG9z3EWTMqGkYZJszp\nRvDNdo7no/mFPeUWq5Of80HI9LdZtd4e+dB3OjzvD9NB4FFWbYp4N48Qm1mp\nn9bxe5N+hizmTsilajf7q3Q1kJWcYWgDSskotowq+//UFpssfKtNqGFK5KUV\n7B6azIQn7GE/0dpR0sKlTvwXkl+9qCgy9nwY9B+yZE2kgkvWDF/SlIB7+4Jo\nXZV+9XRfChxAGvZmQPYeH/V1hZxMjD1vPEc9PtFrIUdVu+pVLlOlqbA+kPW5\nz1ly\r\n=FUa0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFDQkKgyWB6SuO98x9m/JwA6732bDd9nowTi1hr8GTljAiAbjd4s9vOpbOJjRgv74ue0MpeSzMhXrIIrn5eeynTBCQ=="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0-alpha.2_1544518448882_0.5413366970780089"},"_hasShrinkwrap":false},"3.2.0-alpha.3":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0-alpha.3","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/hook":"^2.1.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.2"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"7b27ac160fb022b2f275b850faa70b26347c339a","_resolved":"","_integrity":"","_from":"file:atlas.js-koa-3.2.0-alpha.3.tgz","readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Server)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Server)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@3.2.0-alpha.3","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-c46DGeHBuO+p2hTAuaP0jBwnhQuJTpIk/Unpbi5BtLrVxT2heuhK7kSD6vypEqne4Y6wTBd7hGH66buwSl37NA==","shasum":"7e3e16772668b20db10b7bf79b1df9b5c2415ff2","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0-alpha.3.tgz","fileCount":36,"unpackedSize":130143,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcD7e4CRA9TVsSAnZWagAA0ugQAJegN297XOYbSjBcYkCX\njMslKMYOg+Bq4Hj4rtcjFPKSb34WIjq7uYjaCzbpxk204HXm9J0zYGoVWG5c\nh2/6VTfJ9gsj+lYDs/uVEUSw4yB5KHayeY/iAJUO93nIOpX2i9jNjfMuBfFi\npobzWOj3koIhtprHYRjP4Zt0tB5XoEBig4H5BHVmaQvHzWTtdwyn7M1ddZoU\nRepTKjgwa0bNF528JwY/EBioimmN3rQSyGk+as6jDiS7tMMS8muFks8ej5S0\nRxYS/HGbBvjzmVr4Shn493CdDpiHq9J68XDUKsr4XJA+HFXFrNEyqUIdg2Xc\nQ5I28uuJkAXmP1QDVTFkTN3O/8eCnEV7lXGUFoGh1UgybFwUMhQd7FtBxiCE\nnlw5jx3QGLwdvPXKEMuPTvekw+8PCobwudQapS/6zlhODhDHV8cSCs98VSkM\nX009rb4cGhEledF0NiK0L4u7HZcHl8X7KVRAfHM4MQS7yO3eDWfHnlrFjAGx\n4Tft+2wr7rTgY02DlOKH4C0rxQmduoyAwNX7E17RHzMP2I2UDDrqxBoLenmv\niYO50X0vGNslJF+KxCMMVFRZyUPliSVWlUYJAmH6IHz4UkZAP9zY+lNDEWo1\nF1ycXiOEvziVkqZT9GWr0iHEaMxKZXVw5TwuFu+C1+gNvklKM9dqTYKNN3AZ\nBcEx\r\n=pMLJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGcg/CiLKmnaEMuB6pP/TPt1bUbiqGRjJv0gGuSyaj/OAiEAovAxiQPIJXEcMudTc0n0hntEMhYJj7mTzQ1gCRawYEs="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0-alpha.3_1544533943478_0.632493088505288"},"_hasShrinkwrap":false},"3.2.0-alpha.4":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0-alpha.4","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/hook":"^2.1.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.3"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"ee441a017595bb0b88e20eec1df9cacddfdae96f","_resolved":"","_integrity":"","_from":"file:atlas.js-koa-3.2.0-alpha.4.tgz","readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Server)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Server)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@3.2.0-alpha.4","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-XEq6swqQZa8SJW19Q/NHflvCKZImNCDAIF33XAmSFGoW+0k4OIpUgrmbKl1yFxj1LtW5o5YKlkvkqH4K/oOiPQ==","shasum":"158a48b7591816e6802ed5985c8728dd5e422de1","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0-alpha.4.tgz","fileCount":36,"unpackedSize":128699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEqVKCRA9TVsSAnZWagAAecYP/2OmVf1b2SIK1ZLba0Gx\n5HWuAJ+k+YLRrj5WXWI95bNT1dPqF76IDBRMnSaR26Yjr837H5Z0prORA4ct\n5ooecPBuvO4UGgQTbRw0lD1/A2LG4mP8r0JXLiWVA66b5xW4QEak/rnJZ0I9\nK1hlMTfqWOB70i4dvylqtRfxF2fcrNaK5Iyiex8qC3xMgwQbSb2h9Wdx7ksW\nKFkmLV7hEeSO1x24HbZ6DgegG8l8wBc2iYoRpfmn68PwgL5QONiLBIqPvh8/\n6G8eJshVeWK1NclWb81scEWkMEns49n671GCRnFhhgAJvceWIMgdSFAeYCzQ\n/VhVQioEBv7kuYpt4rrLadNJ6Jnj4Qk78TMMRN8dpix0SD/rp5oNxGKuadZN\n02Y4QA9nomCEk3rwYW83YV1a7IuDi/uuN38j8pAyiS6/4G+3LR4JR6Ugt12E\nY3YD45jta0cNBQKO4jeGdDEvY1lgZwA0Q/jtqLNWQGnTtZrKC/6AF4FgfTaq\nw5d50Isd0fGaoKI1jIRocwmPrZ/pqQBCFLVRZm/bEiGuKtAmmKjXvKzD7j5A\nNqprZvOzHSa1dIprVoc/Yp7hgpzAtem5im/D3/cHKxSEeaX2bB0H7CykeZAC\n0bFCVOZDxweDt7jzUjtjRe08C1hWtyYoyXzBX5iaLiBZoixH7zEFWgE7y/U9\nDssu\r\n=FN5T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+DWq2Nd/6quzGjWEmMhH+JNaWbIjBXNRBeVaicgjxHgIhAK71gaUP6DbTv6EN/ebsF9FY+Et0SERCCrsq5Mnc9PuH"}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0-alpha.4_1544725833990_0.9211275623561084"},"_hasShrinkwrap":false},"3.2.0-alpha.5":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0-alpha.5","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/hook":"^2.1.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.4"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"5a7ec5098e521b7d14d2ecdf584d1bef188c9bbf","_resolved":"","_integrity":"","_from":"file:atlas.js-koa-3.2.0-alpha.5.tgz","readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Server)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Server)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@3.2.0-alpha.5","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"dist":{"integrity":"sha512-YB6IawoRznmWFblIYobJxSsPliTesGt/sRAR0obPFcH4s7bi3+b1qxau7jBNKLFXKUQXCeLHJUggbfat+l2xVw==","shasum":"8344f73ae86bc44bc7ab50542370e252ff6fe7a3","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0-alpha.5.tgz","fileCount":36,"unpackedSize":128699,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcGNcjCRA9TVsSAnZWagAA2zYP/2VK8TDAT5rGi4nWzl5y\ngLvad/yxCJfAjRqI+2gWDP3cvC77cWxtSkH4WQTzi92c8LM5g9FwWFUkAY64\nSMRSCs2H5+Eh1TuWDEXEWGkxqSzJLUwMAy9VDcPB7CnsgIalfSp9WxLXdBwh\nb4Ur9N85z100iaFMITWu9vRZRXTr5zwzxWjX/zCVUhxBWcl7fnT2/eETuILY\nmbebjgJQ5C2C4ujoKAxyC+UzXHlDG7inkaB5lmbPd3iaBoofD3GI0gqhfJYI\neC4C0bbwG/zAc3PVk35BEYXMHAcKgUfe1LXBBZlfQAY0NB5NAOV6AUFDj5gP\nt3EbUUSocK7AtbBi3Zlf2nNljhL2/DSouOu167lhc0erTWQBQEqsBBNvBGql\nc/UWmQ8HX2wWcMiQDvjI4xs5d+mHOo8aZ8TP6a9BLJ8KxLoxbGrPEd/BpDpm\nyXChzf55C3249sPHcRPpEgA4+9+v1qm4zpqYr/8XGyVR2YCIU2pfJ4InLQTk\np4Cn/iiXeBSKPz5XFVnKTGSnceTll2WSZsN1GFe9o7npnje2Bh099utdsTA1\ncmEB6hPbHNLxwZkZu3iY+hNIAy8q2g9hAR68SncUKESHzApZDvz6gfFvtVbA\nY3o0wMpJEaS7VBW7chmmkmAF9TmVA98WrtrvaA870w9InQWSm3DdXScRimWn\nZ5RS\r\n=snKu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvCsJc3ZGrA6cngKo+GopNCaNSQtONnoSR+EVs9xXUYQIhAKpjIx1SFBj2vEZDTSWK6o/AALe4fVWVS1Gs6g9JagEI"}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0-alpha.5_1545131811347_0.47531535631413124"},"_hasShrinkwrap":false},"3.2.0-alpha.6":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0-alpha.6","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0-alpha.0","@atlas.js/hook":"^2.1.0-alpha.0","@atlas.js/service":"^1.2.0-alpha.0","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.5"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"8b27d87a507b5ce31392fc7c02b4b3f22b14a163","readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Server)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport default {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Server)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@3.2.0-alpha.6","_nodeVersion":"10.15.0","_npmVersion":"lerna/3.10.5/node@v10.15.0+x64 (linux)","dist":{"integrity":"sha512-iIH3yPvKYPik5yqA6vBvhXcDfLZaOcJzuZwjEtHofuHTmQch6VOobEKyS7W+sKvvtZOyc8OsfBK7rqMjl6FP2w==","shasum":"c136c239c2d868268d729826a533e6db25dff2df","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0-alpha.6.tgz","fileCount":36,"unpackedSize":129678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPvQkCRA9TVsSAnZWagAAXm8P/igmayE5YPIaI2HUZcMM\nOlPLPJrjRQb/rPYruirBHhFD8MrBUFFnHRwdgTtKk4EYBPeK7Kz87w5pKwGV\nB+xhFCl8+8pKjI1/hIJk7eTw+eF9vhW+fZWas/4Yg2/cOV0WAqStWye6YKfY\nDoz7gLwzdqTk5AiDs+FKicnfh+653zyIv6nHX5H0QUtG5IOQ1OShE67m0coo\nyM+1T8pMdTDgD4HK2QH1niBe3dmy2HTSY90R/GGxu2XQXUwcp051JJg1ZZtc\nSYgFvbfwn4oupdvGH+rzaQNWSnhMVJ+t3U5olAbfok2RRXuLYeWj+uK0WcIY\nQpv00uamMrRRwg5/NNP7cH8elp6A6g3o4ybhA3rznSAVKphRENYsx2y+bi1I\n3CigYbpRsl4ZDBDHIYKgWLUq0mYuJ6WBkQJw5U2Zr2BK2ML0sMUJuK2latvS\nFY3ktfnIbOEptDENTWkcPpj+CRd3OcTb9e+Jyq1dgxc9vmK8L/1L9JMYnX+J\nO7qrtJLJtOH4SHeNbJpWEG3X/jwj/T8RX7Q1CMQMGRy/S/+qLFcdLoHYnqAi\n2vLXqEBD5xIDegxAfiZghx7Dlraq5lQO0WapBQz7c69grjLhiwRWHXNUDxnV\nQ61L6/qcHfBfz3LifcAPff085MJAxGvPakDyqYBLCE8x3P/Fv44fuHh8aG7w\nIS1I\r\n=Oxgw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXFnrNcZN0IhddsXMv+NFx6KQemS2RMdHFCZTZD+HJ/AiAYBpXOhdd4cUlAz3ORTYgewrxBlMHn1FTASQ5DcmVPWQ=="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0-alpha.6_1547629604131_0.1123953107533282"},"_hasShrinkwrap":false},"3.2.0-alpha.7":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0-alpha.7","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0-alpha.1","@atlas.js/hook":"^2.1.0-alpha.1","@atlas.js/service":"^1.2.0-alpha.1","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.6"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"39c0427aa76e1003d5f4acf19cee927925ca0ad3","readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Server)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport default {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Server)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@3.2.0-alpha.7","_nodeVersion":"10.15.0","_npmVersion":"lerna/3.10.5/node@v10.15.0+x64 (linux)","dist":{"integrity":"sha512-nU57rrnphUGR3RUSlmN3ag2r3ahLF/I4vkYDfYHADVe9s6Jf3UOfvw6kpJsG0yWyAjqe0vHQExOty8WdXE2JAA==","shasum":"f12e8be0ee61d99d58ccfd09fad041e623312279","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0-alpha.7.tgz","fileCount":36,"unpackedSize":129964,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTt7NCRA9TVsSAnZWagAAzbYP/ROai4HYBC0LKwZdRL/R\nIJWJ7D6dIa0waW04Z3OK3hk/Qx9iVvqwhyvtDTxECpKnMLqSZEV6RBXVDSw/\n6dDBuPhGTaBbwO68b5gXpro3oiwews4IOZdtd+pATWuOGzmeG75ORqVtQXnC\nopO5eWHDnNRP84IlI2t5i2gZxbWKOHxnHeQ8C6WSr4P4cxZT4CgTRNpPGXVZ\nMcxRSA70lHsA4s6fGEzp4oJcE68GjlqO0U7CsULFGbsd3Ag0i0B9CXc94AGj\nmFLQAATZvxXHQenhdsjDlWDN19VXH49DlFdLGXKoX2Gt+4qisFlqyMrnpwOb\n9MVDM7Y2jbe8NRzil3ZSPKRRIWP+8kL4Lyckxof0pP5cNcOwBv5e2A8/+gWS\nR9RoSNVq/IaUUh3DWHRt8FGizBH0NU0y27E3PeB8JeM2faEyFzg6FsknxY5I\nljwWtv+0jiTLs/s1eGMh97xGEHAYE8+juUOzYsQuB0Ssc+sUbc+r7ulv2qZc\n0Wuib+cbM3N0N9tzrNje5h5evt6EMaPM/e4KHeyljA9tR9zIYKwgg3q2XR1T\nMgP16kAC+X3PrPb9He+T5GsYRywE9FnGkCQfnoi9EwTgi7gpE2EeSnDujIQp\nfpoaVwZtOyzjqgz+XsX/TgDuGWCMcaRkmLAS7pYJ5tdHu0JVDHzxJ8F1b/RX\n6RjW\r\n=QIQM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHuwZ/VybgmoWtPhUqeVnF4/jZMn7MO7whI8q0qSP8taAiEA0ZsRIVESxcsFHiw7UTEuGcCxThyANydhyFl0Z/cRGRo="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0-alpha.7_1548672717323_0.2186770091254917"},"_hasShrinkwrap":false},"3.2.0-alpha.8":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0-alpha.8","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0-alpha.1","@atlas.js/hook":"^2.1.0-alpha.1","@atlas.js/service":"^1.2.0-alpha.1","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.7"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"20fa27bf205f83baaae14c5ef99c6ff8e007b214","readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Server)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport default {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Server)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","readmeFilename":"README.md","_id":"@atlas.js/koa@3.2.0-alpha.8","_nodeVersion":"10.15.0","_npmVersion":"lerna/3.10.5/node@v10.15.0+x64 (linux)","dist":{"integrity":"sha512-15hD3C0LJmVheG/5/whDcOom748BHfpBpZ0pQSHFML28DfnLXKSPqXJ12SFj+1Jwu7zZfWaIGJN6qXumQgD51Q==","shasum":"f779785740d3bbe3c99caa7ae7de21ff468520f3","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0-alpha.8.tgz","fileCount":36,"unpackedSize":130158,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTuJzCRA9TVsSAnZWagAAr3MQAI2kYEmoIXZdc0BPellt\nvdPMG8BigshK1iKs5/PpfJdk79h2Tb/YXaTAsLpFwXuGdUjRINWlKenCm7Pt\nKXVG41dlUNM+ORhpuVEVbl2gwnTwE2xjghetMXQGKeGs5Kpiu6v1P3z8ryHk\nIG6lXd5uJst05UZTOmSkEdecwgz5HKn5KxgZXYpJtSCzbbCxpGBSmfYms0+l\nsFKkgwnvfjxUGYsyug4OUjqG67clD49faSLmX2Jc/ozNnYcgXq8e7pfuiSqj\n2+4/2e6rS1ZE79ykH7r0VFMjtXDw/Be6NYAKwp4DFtEL5gtvalnZt2L1s/qj\nmVEnti+dBhJXxQUM7jOR2eeEh78su+0n9rc0Gic7G+/7+/XSSGuQBCZpaU3l\noa0gCbWaaJiTzX8fX3tmoUrfxdqCiarGCSmvBljVyrPNu4ucdRJLmOtuKu0u\ngyy/HqKpsT+wAYB/Rxp1/uQYCfpVLQnJRNMpWOz0N5KIHK00+2xvTbzYdKtq\nEJyheVmrczYMO9XldkrRyC5AF2YZNOexbMeMHbWW0htDjlwLe8hbImIDyWpC\nD6PPYFXeT7NkUkSTvgXrDi4zNyvdjEbijcmrkYwSppNoJEgyL3q5JL1Hhczd\nA1sqkOirDKt0lq5BhERD4nI8mVcdRpuHOyUS7OlD/TYdPiSYDAvjw6VwILJV\nLsjN\r\n=qdji\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGy7g2oFYRsSd0efj1KKzkmix4+sEeLZS45qxq372WOFAiEAp3oqdNrt3bO7nfaIf/LKTE6xyUpNpZA4MbbVzxnGwb4="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0-alpha.8_1548673650831_0.4187157468743421"},"_hasShrinkwrap":false},"3.2.0-alpha.9":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0-alpha.9","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0-alpha.1","@atlas.js/hook":"^2.1.0-alpha.1","@atlas.js/service":"^1.2.0-alpha.1","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0-alpha.7"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"0b3b3a09a3ca1a751741d7aef417d1f8e7b217f4","_id":"@atlas.js/koa@3.2.0-alpha.9","_nodeVersion":"11.6.0","_npmVersion":"lerna/3.10.5/node@v11.6.0+x64 (darwin)","dist":{"integrity":"sha512-qE06q6BqY8nO1pAIJVi2XRKIegcdLUhEhxxcoiD7kTUNbDxohFt4X6lan/pMJDWrIAPafQXioZZOcibUrdlm/w==","shasum":"1031e4d8615a3afc040f2fef9346e0d87d055ae5","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0-alpha.9.tgz","fileCount":36,"unpackedSize":130804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcVFptCRA9TVsSAnZWagAAjS8P/j9A6Uj3kcRNuNWtZVY4\nXaXE/+7b8dPkMnY/r7eyy4E1cEe6ZKc9TchDeEuTl6K2pdEo3bdgChraylx9\n2/J9b9xgbQrfEHXjYRsAs80wP6eFHcsJAum4VQkKWiFVIeJ2cWcQs+jfwEEu\n9YsWzfpQ5xQLsBumPhFCNSpwlaYRm/wzbwlyKYrLHpe5gfr6/Tf18pxf5LTu\nDvqLh64R9zAtJyhz/NmGrI1dED4mlGm3CLLYxQMEe4X7nGoYj/jpWvBwWaxT\nNlY6NqYKg6681R9zqOTJ4QPDTVy5KDLM3gbotsRC1+K0L5JULpv9ZjVkmyEn\n9gRDZxY5c+ALgCHS1GubRsiQdmicLcxKPPyv2EKdovoToz2vaD3EyjlP24Ws\neKyOFSdx+xoQSaJs042pB2ilBW2evK1wmLjtfffS47l5jqT1DOrstVkUDaXc\n7K47Wp6EUvzgyKaS5QeKvBr4oNNeMy0uPgpVozvSHQ5wvFUIoEcEyCljFs4F\nEi8D59wSoyf1FJVoJBe4TxEvcfF3m3CLHjvc24Ay0v1eEmy3jYpsnQeTEYhk\n6JuhTEdMsznrWSJfIt4JZejPZN/0LQ3B5CXOAZC7456oiPJZ6cl998q8dc+S\nx0ZU7zRHCfMmc6HZ63/RwkdUVoh9uA7tDrQT/dNLntrfS+cuNlraNLtC5cji\nWQYy\r\n=psff\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGJAD3jXJk5jKo8sqzrU2CgZDmrwGcGz9DG3znNaS8iQIhAJmni93pQO0zieGjdbSjKTA8CfnCeamySmTghVweD3MD"}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0-alpha.9_1549032045139_0.2987256570214307"},"_hasShrinkwrap":false},"3.2.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.3.0","@atlas.js/hook":"^2.1.0","@atlas.js/service":"^1.2.0","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.2.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"e67f1220a6aa157ef078f26075b6aa5bfad5ee18","_id":"@atlas.js/koa@3.2.0","_nodeVersion":"10.15.1","_npmVersion":"lerna/3.10.5/node@v10.15.1+x64 (linux)","dist":{"integrity":"sha512-NpntJI4FbYVqP/RtvN6dMl70aWGPFIAv5or6UV96Vh4KshKpN81Y6fjpgp1OrLSUQFnwDZObOEeQLGSPFZCUAA==","shasum":"9575885ba9e0302eaa275db5425ed3a8a5e43122","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.0.tgz","fileCount":36,"unpackedSize":131902,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcXWHoCRA9TVsSAnZWagAASMIQAIzjiGPSc3pvi09Je9NL\nhXyWAcmMkoTvMa7eecXAYd8UtgsuUAG3pQnjEq7HKFLGtdTSSZwQja83yCet\n4BFJl422eK2P9i7G4E0i3wWB7KDKcU3u1Pt4+8tXPr9nFk8SqH4BKIFiKKKy\nY9WuvjV33g5cbZVbWxhPb6Y5EuOJ3g4HrGfWh2m9U4NkEQ8cLSftksm4MobM\nfUv/bWMqA3bJmBp6J3Z0gsfP2vX5wi8zMjpfpouFi+bDiQQdK8VGNgUq7rUe\nbVy/PuyR2tzMcvNQYOdaWTPOpi7sSiX9IJ2ytGrFuS41M2iKWubfb4PSZakq\nInuoGptz0HM9rsd4kY+ELIQ7ZgbnZQdK509YdiacFbHom3XGVivM3NsaPIp3\nMHxqWPi5oPlHjoa/yp3kLnnqPAHecomFHtsLxt5XeT4iHRry1NN5jvXzLB/2\nQbhBbFo1OdSemdKydBR6H4lKPQ18TOLQL3BvEeE8FlpQRokCiL2xxksSkioP\nXX5CWIDVvKhU04zvZdjv96mA6yqkqVaLohUI1+jnj04zrNqM7xTT6UXmDXSb\nGplxXszooXVuac07rwpQkdmM/CJ+up1RDhm+qYul9MiCEaNF3TXaFPoYt8eb\n2CToKE9cvGrwFM0mOEHI0+0Y6+jlSpcxkLg/qasBZDgJiv8Wzv0+pxq2SWe1\navYF\r\n=zSKy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDp1LZSa7Joeh1AZvU4H982eokaf59AKzyNkBbg/zDA7gIhAKGhfeGdrT58K9Wi9sZbMlpNpwAKNc8k5aiAmnGzBYYt"}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.0_1549623783649_0.32303491157600805"},"_hasShrinkwrap":false},"3.2.1":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.2.1","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.4.0","@atlas.js/hook":"^2.1.0","@atlas.js/service":"^1.2.0","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^4.7.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.3.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"5c97a07bd8836b5ec1324990def51e7a310154af","_id":"@atlas.js/koa@3.2.1","_nodeVersion":"10.15.1","_npmVersion":"lerna/3.13.0/node@v10.15.1+x64 (linux)","dist":{"integrity":"sha512-hCFLBJyNPvHh3Ix7CZAAE3RrdLjrDy65WMMPS+IbTOB1K/xxsnYumvcpkW12NDGetOyNWE0vjjS/yzdRvbGRTg==","shasum":"627f4087fd58533a5d7f14a1becc34300399cf6a","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.2.1.tgz","fileCount":36,"unpackedSize":132073,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbUmNCRA9TVsSAnZWagAAh9cP/0zaDUAW2+B5cYYP9PKq\nEXnJkcRmg5OluSGDCcLOMYn45FxidBHqnOAzpos0CxJ5Z7w5fLS+9+29atl+\neu6+KAZ9D2+QG7wOpToI5XobzfNtKtWvelO831ZtiSfuQZD5bfsSj03Pnr/V\nByELnxQjY2GWgvqKBR5inFn5F7Zo1YXSC0GfPjiZ+yuhiTwA3Qn//mT0PTfS\nf+otFaZFDiauN2BRWGbqmjzqLoxMT3SHwAzFO6Fy9OOKYa+wCOowmJPrZz3L\nUhVRhNuFnjOrz+PoX7UHAM7Zt5JtzhvcG1FCxL2NzjCquGbnMO5YEfi+rscR\nFnsj41Hp58LXOYUDfuLrFsbnbJxUsEZYTm977ojfuEnWabCrph94vjgw7yAa\nIo7/5v9LWW4rkJlPgZ4acpBPpwsRpLUUQ4F4wGggJyLHqm5K2WNmLXRmFYFG\ncOUUeRDXhhR6jCN1NJY7AGX6QFvKRIEuue6+gauPC6yO3KfYzA1CgzbanU4w\nHVeovwu0skh6CjCV8iFC/Jf1eJNrrbWWyE1MKjJVnmfWSbzl9IBwdzGxdSHU\nKjdicKzDrcZFhF7iBD+z/VVfobUt7Dlmxlw+ngaMnGxfdmuRg8KmTdpIChVS\nZ39GVXBKKflxdLUVPb5MAK5xG/D75fGTFGF2KVQjXU9KJvPTC8NHPwcQ+YTu\n2uFH\r\n=AuNB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQCaX5llILWFPioNDd26ivQqTLl63l8gzVWrRzhyiwy8bwIfLXHaZIy93fLHWlwvxQXsC3aHAobdV5zUyeQLWeOZMA=="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.2.1_1550666124311_0.03697237807520981"},"_hasShrinkwrap":false},"3.3.0":{"name":"@atlas.js/koa","description":"Koa.js service for @atlas.js","version":"3.3.0","author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"contributors":[],"dependencies":{"@atlas.js/errors":"^0.4.0","@atlas.js/hook":"^2.1.1","@atlas.js/service":"^1.2.1","@types/koa":"^2.0.0","@types/koa-websocket":"^5.0.3","@types/pino":"^5.8.0","koa":"^2.3.0","koa-websocket":"^5.0.1"},"devDependencies":{"@atlas.js/atlas":"^2.4.0"},"engines":{"node":">=8.3.0","npm":"^5.3.0"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"license":"BSD-3-Clause","main":"src","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"gitHead":"6c9ce4041de9f5c386b205e72c656443101327b0","_id":"@atlas.js/koa@3.3.0","_nodeVersion":"10.15.3","_npmVersion":"lerna/3.13.1/node@v10.15.3+x64 (linux)","dist":{"integrity":"sha512-5y8xsDJN2l7rx55xkIV0uP8OQZsq6J+0m6YYMLCjsyJlDiC/tIfCYOsoYcLPyLxpe5PGA10DY/PR1iGMowqRaw==","shasum":"be0c296a98d724208c3bc677b3aaf755145285a8","tarball":"https://registry.npmjs.org/@atlas.js/koa/-/koa-3.3.0.tgz","fileCount":36,"unpackedSize":132300,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpz0+CRA9TVsSAnZWagAA7pQP/AvjGVbszP/3O9mIcneB\nFAMnVzRY2xCDR19emito8UjMs5OU/qRmv6uAEc/qUNkUMQ4/aZymfYx787Wc\nFMVZDePP02XGyqmKHIbAU0uQfBC728DZpEu26ypQoeKGL/HdQWOn+p70bMA9\n05IJ/lK07FDoQh/ctnOAlx/AUeaOLYoSbjhVJigqwkTipJP5tB1qh+BjJe43\n0DvhS7ZrnKXkMVgp3dsxqQjc+NsRiC5sBMTGoXXir93KMwUpgYIaibzLpr/b\n3x1spR5zE5yZ6WP3Dk3OpHOAc243ztL1cWYzgqM5KvgqDRdryBSFWPACd/Y+\nU6JT4YBIrq44R95EcL5sggXxOnux683JgmnvcS92hT9eV/zjUK+6i0pVz64m\nU+zMcJ8cixQpzJTqrN4h8V+UYJ0pwVVY7kq80vny7loPRGbf0922iJzyNlpr\nXaza/LYz4y0rkgBNKfQbW44OBjQrViQre1ccB5vuX1uo58dO8411cO+hmjuA\nVWxrVSQTLAhM00MXc3VTt8INirhbBF2AdNf1Jwd94EeVjC4F5p1WeEuz7uuM\nIQOttVs643FBJzlWm20wjXYOnqa57HvxJ9v+/9qxM3v/oGK8vrMeQXIF7Gcg\n4Xy0pFvpNxpZjicZO4osoO6UkNt6Pu4TbDmK2U8uj7ifVhX2X0GlcSv6u2fx\ncrAx\r\n=VhWX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEvdSci5Dv5LFp9lAIkaSNqE8Carj7eOmPkxW31k3LxmAiEAwhSo8r++b7DQgKjwWxF+peuIet91qt3J5alKXax34EQ="}]},"maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"_npmUser":{"name":"robertrossmann","email":"robert.rossmann@strv.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa_3.3.0_1554464062150_0.28780208296892074"},"_hasShrinkwrap":false}},"readme":"# @atlas.js/koa\n\nKoa.js service and a Middleware hook loader for @atlas.js.\n\n## Installation\n\n`npm i @atlas.js/koa`\n\n## Usage\n\n### Service\n\nThe service configuration allows you to define three things:\n\n- `listen`: A bind configuration, ie. to which host and port to bind\n- `koa`: Koa configuration, ie. all the [properties you can set on the Koa instance][koa-settings]\n- `server`: http configuration, ie. all the [properties you can set on the http server instance][http-settings]\n\n```js\nimport { Atlas } from '@atlas.js/atlas'\nimport * as Koa from '@atlas.js/koa'\n\nconst atlas = new Atlas({\n  config: {\n    services: {\n      http: {\n        // Listen on this port and network interface\n        listen: {\n          port: 3000,\n          hostname: '127.0.0.1',\n        },\n        // These are set on the http.Server instance\n        server: {\n          timeout: 30000,\n        },\n        // These are set on the Koa instance\n        koa: {\n          proxy: true,\n        },\n        // If set to an object, will be used to load all middleware found in this module into the\n        // Koa instance\n        middleware: {\n          module: 'path/to/middleware',\n          config: {\n            bodyparser: {},\n            // ...\n          }\n        }\n      }\n    }\n  }\n})\natlas.service('http', Koa.Server)\nawait atlas.start()\n\n// The Koa instance is now available here:\natlas.services.http\n// And the http.Server instance is also exposed:\natlas.services.http.server\n```\n\n#### Example middleware module\n\nHere is an example middleware module that the service supports.\n\n```js\n// middleware.js\nimport forcehttps from './forcehttps'\nimport routes from './routes'\nimport notfound from './notfound'\n\nexport default {\n  forcehttps,\n  routes,\n  notfound,\n}\n```\n\n#### Accessing the Atlas instance\n\n> The Atlas instance can be accessed through `ctx.atlas` in middleware or routes.\n\nHere is an example middleware that makes use of the Atlas instance inside the route handler. It returns 400 status code with a custom message when the request is made on an insecure protocol.\n\n```js\n// middleware/forcehttps.js\nexport default function mkforcehttps(config) {\n  return function forcehttps(ctx, next) {\n    // Here you can access the Atlas instance via `ctx.atlas`\n    if (ctx.atlas.env === 'production' && !ctx.secure) {\n      ctx.response.status = 426\n      ctx.response.set({\n        Upgrade: 'TLS/1.2, HTTP/1.1',\n        Connection: 'Upgrade',\n      })\n      ctx.response.body = {\n        message: 'I refuse to talk to you while anyone may be listening.',\n      }\n\n      return\n    }\n\n    await next()\n  }\n}\n```\n\n### ContextHook\n\nThis hook allows you to extend the Koa context object prototype with custom functions or properties. It might be useful to define response type aliases, such as `ctx.ok()`, or `ctx.forbidden()`.\n\n#### ContextHook Dependencies\n\n- `service:koa`: A Koa service on which to extend the context\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      context: {\n        // The path to the module, relative to root, which should be loaded and\n        // properties/functions from that module added to koa.context\n        module: 'server/context',\n      }\n    }\n  }\n})\n\natlas.service('http', Koa.Server)\natlas.hook('context', Koa.ContextHook, {\n  aliases: {\n    'service:koa': 'http'\n  }\n})\nawait atlas.start()\n\n// server/context.js\nexport default {\n  ok(body = {}) {\n    this.status = 200\n    this.body = body\n  },\n\n  forbidden() {\n    this.status = 403\n    this.body = {\n      error: 'Forbidden'\n    }\n  }\n}\n```\n\n### WebsocketHook\n\nThis hook extends the Koa instance with websocket protocol support, using [koa-websocket][koa-websocket].\n\n#### WebsocketHook Dependencies\n\n- `service:koa`: A Koa service on which to add the websocket protocol support\n\n```js\nconst atlas = new Atlas({\n  config: {\n    hooks: {\n      websocket: {\n        // This has the same structure and purpose as the Koa service's middleware config: it allows\n        // you to add websocket-specific middleware to the server.\n        middleware: {\n          module: 'path/to/websocket/middleware',\n          config: {}\n        },\n        // This goes directly to the websocket protocol's constructor. Note that you should not\n        // use `host`, `port` or `server` options since the server instance is re-used from the\n        // underlying Koa server and creating a new http server could cause unwanted side-effects.\n        // See: https://github.com/websockets/ws/blob/master/doc/ws.md#new-websocketserveroptions-callback\n        listen: {},\n      }\n    }\n  }\n})\n```\n\nOnce attached to a Koa servise, the websocket interface is accessible as per the library's definition via `koa.ws`, which in Atlas it would be:\n\n```js\natlas.services.http.ws\n```\n\n## License\n\nSee the [LICENSE](LICENSE) file for information.\n\n[koa-settings]: http://koajs.com/#settings\n[http-settings]: https://nodejs.org/api/http.html#http_class_http_server\n[koa-websocket]: https://www.npmjs.com/package/koa-websocket\n","maintainers":[{"email":"robert.rossmann@strv.com","name":"robertrossmann"},{"email":"licenses@strv.com","name":"strvuser"}],"time":{"modified":"2022-04-04T16:08:33.914Z","created":"2017-08-10T16:54:46.132Z","0.0.2":"2017-08-10T16:54:46.132Z","0.1.0":"2017-08-16T08:42:52.249Z","0.2.0":"2017-08-16T13:55:29.420Z","0.2.1":"2017-09-02T12:28:32.608Z","0.3.0":"2017-09-05T16:42:06.275Z","0.3.1":"2017-09-05T23:03:30.804Z","0.3.2":"2017-09-07T16:00:48.042Z","0.3.3":"2017-09-22T08:07:02.494Z","0.4.0":"2017-09-26T11:35:05.372Z","0.5.0":"2017-09-27T08:50:29.890Z","1.0.0":"2017-10-24T20:48:30.993Z","1.1.0":"2017-11-21T10:00:16.164Z","1.1.1":"2017-11-27T09:54:24.376Z","1.2.0":"2017-12-13T11:56:33.722Z","2.0.0":"2018-01-18T10:26:49.792Z","2.1.0-alpha.a596c671":"2018-05-14T15:01:28.287Z","3.0.0":"2018-05-22T15:37:01.470Z","3.1.0":"2018-07-12T12:31:38.992Z","3.1.1":"2018-07-16T05:51:12.325Z","3.2.0-alpha.0":"2018-12-07T13:18:44.939Z","3.2.0-alpha.1":"2018-12-10T09:09:51.499Z","3.2.0-alpha.2":"2018-12-11T08:54:09.082Z","3.2.0-alpha.3":"2018-12-11T13:12:23.822Z","3.2.0-alpha.4":"2018-12-13T18:30:34.125Z","3.2.0-alpha.5":"2018-12-18T11:16:51.517Z","3.2.0-alpha.6":"2019-01-16T09:06:44.284Z","3.2.0-alpha.7":"2019-01-28T10:51:57.600Z","3.2.0-alpha.8":"2019-01-28T11:07:30.932Z","3.2.0-alpha.9":"2019-02-01T14:40:45.257Z","3.2.0":"2019-02-08T11:03:03.982Z","3.2.1":"2019-02-20T12:35:25.379Z","3.3.0":"2019-04-05T11:34:22.433Z"},"homepage":"https://github.com/strvcom/atlas.js/tree/master/packages/koa","keywords":[],"repository":{"type":"git","url":"git://github.com/strvcom/atlas.js.git"},"contributors":[],"author":{"name":"Robert Rossmann","email":"robert.rossmann@strv.com"},"bugs":{"url":"https://github.com/strvcom/atlas.js/issues"},"license":"BSD-3-Clause","readmeFilename":"README.md"}