{"_id":"static-koa-router","_rev":"4-ce7244d45602960cb3119c63fa9b5d44","name":"static-koa-router","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"static-koa-router","version":"1.0.0","description":"Serve static file through koa-router","main":"Serve.js","types":"Serve.d.ts","scripts":{"test":"jest --config jest.config.json --detectOpenHandles --runInBand --forceExit"},"repository":{"type":"git","url":"git+https://github.com/owencalvin/static-koa-router.git"},"keywords":["router","static","koa","file","serve","html","css"],"author":{"name":"Owen Calvin"},"license":"MIT","bugs":{"url":"https://github.com/owencalvin/static-koa-router/issues"},"homepage":"https://github.com/owencalvin/static-koa-router#readme","dependencies":{"koa-send":"^5.0.0"},"devDependencies":{"@types/axios":"^0.14.0","@types/jest":"^24.0.9","@types/koa":"^2.0.48","@types/koa-router":"^7.0.40","@types/koa-send":"^4.1.1","@types/node":"^11.9.5","axios":"^0.18.0","husky":"^1.3.1","jest":"^24.1.0","koa":"^2.7.0","koa-router":"^7.4.0","ts-jest":"^24.0.0","ts-node":"^8.0.2","tslib":"^1.9.3","typescript":"^3.3.3333"},"husky":{"hooks":{"pre-commit":"npm run test"}},"_id":"static-koa-router@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"9.11.1","_npmUser":{"name":"owencalvin","email":"owen.gombas@gmail.com"},"dist":{"integrity":"sha512-YOijFftMWMttH5NhBlcqf8LORlDjIFtNoGo2p+Ofdg7j5UjzLXcZxX6DxegWMXr/eakq4HD5cOp3XTJ/lpjg5A==","shasum":"8a9fe736cd73430aa79e9e2232820a27afaf6526","tarball":"https://registry.npmjs.org/static-koa-router/-/static-koa-router-1.0.0.tgz","fileCount":17,"unpackedSize":8990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcd8ZuCRA9TVsSAnZWagAAEF0P/0bRi8ZQTt49x71d7y8h\nYX5DhU4L+U2MvIf6sFGhpw1Ds4XzOJG4E4EzHv/Xm9wrqAm6veg2bUjhSm9r\nrn2IC4XQFNN6G9FiossECSV3ioO3HPyLRFhuFGnHdpad9RYIJuunxOfizvrm\n7VbBkwSyR3b2MffcYYNTEvFVzVaL8VxpZDQJUgHrWiOIy5nCbHoo+pUNKULb\n7NafM9uZorkny08IKPiVetL0khTuJmnmb2L6TyPyORMNFF1ayQiwsptuCtWe\n/IgZlkR8ShIWlniDIDSW6/wmJz5zKAIOz/LS5LZDTo62gFYePr+ZgHseqDvE\nByKKfBCNCB/RmfJhkdxKapWjon0a5vRrFqQ7vfusyCSVFpUbCE1V93GNbB/W\nsbj+8eS4jtUJ5CxeyOFz+OOBpbypxsroz4qnxG/Ifzphj9G8f2dBnJz/R9bN\nmEneEVUSB07srIYWk0F6EtxqSIirvhaF4Meq+rnTB7tuBisOdsZAFkuPa2ax\np5KCHRgpdIfDrU0MWDsGgAYnhZKVnFo6OHRnsCsin6vY2+a6G4GQSo3WPkIb\nJEDD2ICkYk6gLh1fW/axalFLP67izzBGdi6QyGoMPx2imODh87OuiYHOGqDB\n2Xpe108XwK+qQdAWtE+eOgSnUtuCtjtsfz5ZmPY48cbbDm65Zyod2kt62OFf\nyNZJ\r\n=bMfO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG/Iv7iWz3OUBMjs1NsI9+p9Em+UYmI01XZUhpeqygsKAiEAgg9BQYjG1gAQfM7OyYLbHLCrrQv2t9RM9G4QmT9VZ60="}]},"maintainers":[{"name":"owencalvin","email":"owen.gombas@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/static-koa-router_1.0.0_1551353453851_0.8551707305189009"},"_hasShrinkwrap":false},"1.0.1":{"name":"static-koa-router","version":"1.0.1","description":"Serve static file through koa-router","main":"Serve.js","types":"Serve.d.ts","scripts":{"test":"jest --config jest.config.json --detectOpenHandles --runInBand --forceExit"},"repository":{"type":"git","url":"git+https://github.com/owencalvin/static-koa-router.git"},"keywords":["router","static","koa","file","serve","html","css"],"author":{"name":"Owen Calvin"},"license":"MIT","bugs":{"url":"https://github.com/owencalvin/static-koa-router/issues"},"homepage":"https://github.com/owencalvin/static-koa-router#readme","dependencies":{"koa-send":"^5.0.0"},"devDependencies":{"@types/axios":"^0.14.0","@types/jest":"^24.0.9","@types/koa":"^2.0.48","@types/koa-router":"^7.0.40","@types/koa-send":"^4.1.1","@types/node":"^11.9.5","axios":"^0.18.0","husky":"^1.3.1","jest":"^24.1.0","koa":"^2.7.0","koa-router":"^7.4.0","ts-jest":"^24.0.0","ts-node":"^8.0.2","tslib":"^1.9.3","typescript":"^3.3.3333"},"husky":{"hooks":{"pre-commit":"npm run test"}},"_id":"static-koa-router@1.0.1","_nodeVersion":"10.7.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-WPTs9FMiD0yX+kcxc7ZApwb6eiQrIotsWTDZERUa/CRJ8uvmyydDsifpR6w/4tIz8h1/VrMkqaIiYQ2QYyw4mQ==","shasum":"d3bbd1babe1068d427969a8dce45d364b0125963","tarball":"https://registry.npmjs.org/static-koa-router/-/static-koa-router-1.0.1.tgz","fileCount":17,"unpackedSize":9360,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceR1GCRA9TVsSAnZWagAAi9kQAJpi2J2heWA17lW/yN4h\ntjRGS5Tdi6TGmGvXbl9Ym0TqtmAAlcjETEz77amyEDq3RCNeKGw9WzCrhxtI\nERjUMd40vNqOsrNC8kvvMzsySGc8+GMWkX7eMk5ZI9083czJ95ewgsxGXdZn\n0wokFBhjEK8c38vvVLecoWh0YoI6k2y1h0Pvd5hlBMQJMH14lmFY92IBkVG0\nVUuOQzDiozzSdfvSn0b1qAwyLmOzMr05KLXxNI3hCPtktqSOk+rsJ1QKihK3\nbI8w4U9M/UVGBiA9UenuUB36kx1udG+aEZ5Zqs+Km5LRF9AunzPGVqTzKu4k\nHBEzCuvZl7e6IOP9u/1bu/5t4kzYZixOb7cLKixDjAEkFcPxcFxyMP3RXCnw\nmp9zmqrkjssuncT98L7CX0SxvJ5U86wsmCbA2LDZ+Zxp/EuVWAs23e/TdlT2\nYFlo28iK98cLvAAgrE7SbO84UqXlpHNil0AfYoxPogph46eprpF95f3TeOI8\n42D1PJm4ObzVhHfeoJgcqJtmgQ3oWJZWJ3NRHKb1ERW8U7d8QlfE4eYuWDjh\nTe5JdFiT+rpnpPlSlWXSYmC/R/ts52hHWkvTcrt2itijnTEKOumXsdJI3F1M\nO0mhVzHhoNoHeQjuB8g4kECXnX8uQ9Hd39d0wLNn2q/ZSL6fP+R86zcrQDb3\nVX04\r\n=UAPk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDs6/CQwr7KDMul7McYsLPT57cCCTVrN3mVU62cDJ1OGQIhAOZr09Qs7Rn7sGm2uZyXI+eqaavktLyvBPrVua7AXk/h"}]},"maintainers":[{"name":"owencalvin","email":"owen.gombas@gmail.com"}],"_npmUser":{"name":"owencalvin","email":"owen.gombas@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/static-koa-router_1.0.1_1551441221801_0.5103574651258509"},"_hasShrinkwrap":false},"1.0.2":{"name":"static-koa-router","version":"1.0.2","description":"Serve static file through koa-router","main":"Serve.js","types":"Serve.d.ts","scripts":{"test":"jest --config jest.config.json --detectOpenHandles --runInBand --forceExit"},"repository":{"type":"git","url":"git+https://github.com/owencalvin/static-koa-router.git"},"keywords":["router","static","koa","file","serve","html","css"],"author":{"name":"Owen Calvin"},"license":"MIT","bugs":{"url":"https://github.com/owencalvin/static-koa-router/issues"},"homepage":"https://github.com/owencalvin/static-koa-router#readme","dependencies":{"koa-send":"^5.0.0"},"devDependencies":{"@types/axios":"^0.14.0","@types/jest":"^24.0.9","@types/koa":"^2.0.48","@types/koa-router":"^7.0.40","@types/koa-send":"^4.1.1","@types/node":"^11.9.5","axios":"^0.18.0","husky":"^1.3.1","jest":"^24.1.0","koa":"^2.7.0","koa-router":"^7.4.0","ts-jest":"^24.0.0","ts-node":"^8.0.2","tslib":"^1.9.3","typescript":"^3.3.3333"},"husky":{"hooks":{"pre-commit":"npm run test"}},"_id":"static-koa-router@1.0.2","_nodeVersion":"10.7.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-98QBczc5goK3NePs0asz1JmQQ8b0s/3kw3wwGWykO4s9ov6ByVAoMBB8JWn9y8g9UozAsBWBb5myL1PpFAB5jA==","shasum":"d95eeb85cb51d5281bd5bd183e05a83b540b3a7a","tarball":"https://registry.npmjs.org/static-koa-router/-/static-koa-router-1.0.2.tgz","fileCount":17,"unpackedSize":9980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceR+gCRA9TVsSAnZWagAAWgsP/0a4LC/MX03WIzXynhdj\na7PyVw0RxONaU5Dj6h+9AJ/42SiUWJ2aPj7WQMABik+Dtr2SINEcPCd9u/Za\n5VAllNBFpsmHOq4wrhOOHm09RpSHVZOKUjSmthiegMyPnFjTHogGXLBfOviB\nJdjlDJjlTMzJUdt1SzvrWP6xh7gqOFwXqOTCujN0Nlohc4Cmad7vzA3lYoso\nRJocFUAujz4BdN26ncstQVy6wubbNnertD54Gwh+nb3BebE2lVShGR7PTwr9\nT0/MAlm6QDt8lcQRnjryWnUeklkQUbHIShhYJTSJFIeKbHDIOLuYSE9EfSDa\nYC3ZsCYoM1wGBnn2232qCbdlcPZduOR1+lgzeMzwpRzeA2c1zzocqynRpoqM\nEwZPSE18OKpJN0qZe6GjNWSI4WSS2Ezk8cYSd4NwePsmuWlVBdQnt7NPyAqV\nfLy5YEh1Q+D66wkWT4yke+EQZZtMlqbCOhN+MvQa8GuGrak+C/lgGuXpSQ6d\nXa/19AicIkRfFSFagnQ9+0HqFnOF3Y9X8TAbR1B81WfOFiUNRR+Fp81N4pnE\nVKNDCpRNL2YAbO8WhK4ExmUrRGCcJ9BNtDFWb6fCK46y4EMCChouOPVfsTnb\n9trWmxY5Rj9X1N4le/D5UP+EitpZz2XmkGgPqglqflAmpCDxYL7I5d681VYV\noF12\r\n=lmdC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEBxNTMr/oreXmvxO1qu/k4JXjIFZW7nmeqw6eEuz1n3AiEAj/O7dmRY+EjYzGByzM5stjw1Pq+2W/NdoE4BxccKBmg="}]},"maintainers":[{"name":"owencalvin","email":"owen.gombas@gmail.com"}],"_npmUser":{"name":"owencalvin","email":"owen.gombas@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/static-koa-router_1.0.2_1551441824143_0.41834502581354793"},"_hasShrinkwrap":false},"1.0.3":{"name":"static-koa-router","version":"1.0.3","description":"Serve static file through koa-router","main":"Serve.js","types":"Serve.d.ts","scripts":{"test":"jest --config jest.config.json --detectOpenHandles --runInBand --forceExit"},"repository":{"type":"git","url":"git+https://github.com/owencalvin/static-koa-router.git"},"keywords":["router","static","koa","file","serve","html","css"],"author":{"name":"Owen Calvin"},"license":"MIT","bugs":{"url":"https://github.com/owencalvin/static-koa-router/issues"},"homepage":"https://github.com/owencalvin/static-koa-router#readme","dependencies":{"koa-send":"^5.0.0"},"devDependencies":{"@types/axios":"^0.14.0","@types/jest":"^24.0.9","@types/koa":"^2.0.48","@types/koa-router":"^7.0.40","@types/koa-send":"^4.1.1","@types/node":"^11.9.5","axios":"^0.18.0","husky":"^1.3.1","jest":"^24.1.0","koa":"^2.7.0","koa-router":"^7.4.0","ts-jest":"^24.0.0","ts-node":"^8.0.2","tslib":"^1.9.3","typescript":"^3.3.3333"},"husky":{"hooks":{"pre-commit":"npm run test"}},"_id":"static-koa-router@1.0.3","_nodeVersion":"10.7.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-PzzlnH8P7hwndumEn4HH5J/OVd4kX4SUrCEa7dehgUNZg98AipPGo+Q2a81FKR0tRtFAIfH8M4JIlxGC5jBB5g==","shasum":"54bac6967afd4bd159b330ba679f668e513bce8d","tarball":"https://registry.npmjs.org/static-koa-router/-/static-koa-router-1.0.3.tgz","fileCount":17,"unpackedSize":9960,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJceSL8CRA9TVsSAnZWagAAEYEP/AtUI0CHj6KHuElfuLjm\nnP0MnlKsKh5h1NLwObIGd6Y3tXoZsXMu656gXc/sIhho8xXsGaEm3PhpDXVP\nP4UvnD//g0jDNASPCQaJuEe76IYj4kO8tERzQmv5lAJYkrNFN9cORZ0MElyY\nqBaW/tNKSPwcIDdyE17Np5rtwKTY7wLlJK5b2VkJe1FKvsLW/z5sIoGrMbwn\nr0aE6dgq1ALiPjfyva7e8IHwdFUuHzIKiGrLI80BVhQthXazVCvsZuWA3HWw\nyYV+CriwTCDJyG08rHH4laG+uX4Eiw8AlyFaj8FNX0Y4zT2Vp4YbUjAdBclA\nLadITRNLzxKrGqEV1L48a/NZn1GGQMX9N7QIj8F9Jitx0ZRsbt188bJ2jStq\nUyA0ZPgwDIVogVG7ZJAbe9pHzuhBOt2awh9jjhhy1p12MIg/h8/yDNy+PcpQ\nXgdDPO1uqVpVDsxPrZonigp4kMrLi8lh8mllqCLg4ouFpBoubxAOxFMuVQ1g\nZldbYfe5AqGg4cbzz8CzGlLIW0OwP512YhTkniazB8z5RQmjnBpft5a1bP6o\n6QOzW9yS2xliEwrgQAcBeGGm5mjRrkmrVd0sBjjJQphO5Y1L68Teso9dpWBs\n616112/L+pn7eB9KdsiwV/6DYpxRgVtw4wwvMXBmHpOW62TGcOM/dqzv7dOC\n1V3M\r\n=w/cx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEWkCLGCfBaUenzsQ6O01SJSBURaG5qrDg629oO58L37AiAFKV+AfwYKcPJDgbbagKIRtDg2Qg/8/NbDXidEFvCjkw=="}]},"maintainers":[{"name":"owencalvin","email":"owen.gombas@gmail.com"}],"_npmUser":{"name":"owencalvin","email":"owen.gombas@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/static-koa-router_1.0.3_1551442683758_0.09483407995635784"},"_hasShrinkwrap":false}},"time":{"created":"2019-02-28T11:30:53.851Z","1.0.0":"2019-02-28T11:30:53.960Z","modified":"2022-05-18T16:25:38.286Z","1.0.1":"2019-03-01T11:53:41.935Z","1.0.2":"2019-03-01T12:03:44.275Z","1.0.3":"2019-03-01T12:18:03.908Z"},"maintainers":[{"name":"owencalvin","email":"owen.gombas@gmail.com"}],"description":"Serve static file through koa-router","homepage":"https://github.com/owencalvin/static-koa-router#readme","keywords":["router","static","koa","file","serve","html","css"],"repository":{"type":"git","url":"git+https://github.com/owencalvin/static-koa-router.git"},"author":{"name":"Owen Calvin"},"bugs":{"url":"https://github.com/owencalvin/static-koa-router/issues"},"license":"MIT","readme":"# Serve static file through koa-router\n[![Build Status](https://travis-ci.org/OwenCalvin/static-koa-router.svg?branch=master)](https://travis-ci.org/OwenCalvin/static-koa-router)\n\n## Installation\n```\nnpm i static-koa-router\n```\n```\nyarn add static-koa-router\n```\n\n### Usage\n`Serve(dirPath: string, router: Router, options?: Options)`\nYou simply need to pass the **dir path** at the first parameter, the **router instance** (koa-router) at the second parameter and optionaly the **options** at third parameter.\n\n##### Options\n - `maxage` Browser cache max-age in milliseconds. defaults to 0\n - `hidden` Allow transfer of hidden files. defaults to false\n - `index` Default file name, defaults to 'index.html'\n - `defer` If true, serves after `return next()`, allowing any downstream middleware to respond first.\n - `gzip`  Try to serve the gzipped version of a file automatically when gzip is supported by a client and if the requested file with .gz extension exists. defaults to true.\n - `br`  Try to serve the brotli version of a file automatically when brotli is supported by a client and if the requested file with .br extension exists (note, that brotli is only accepted over https). defaults to true.\n - `extensions` Try to match extensions from passed array to search for file when no extension is sufficed in URL. First found is served. (defaults to `false`)\n - [setHeaders](https://github.com/koajs/send#setheaders) Function to set custom headers on response.\n\n### Examples\n\n##### Typescript\n```javascript\nimport { Serve } from \"static-koa-router\";\nimport * as KoaRouter from \"koa-router\";\nimport * as Koa from \"koa\";\nimport * as Http from \"http\";\n\nconst app = new Koa();\n\nconst router = new KoaRouter({\n  prefix: \"/public\"\n});\n\nServe(`${__dirname}/public`, router);\n\napp.use(router.routes());\n\nconst server = Http.createServer(app.callback());\n\nserver.listen(1337, \"localhost\", () => {\n  console.log(\"Server started\");\n});\n```\n\n##### Javascript\n```javascript\nconst { Serve } = require(\"static-koa-router\");\nconst KoaRouter = require(\"koa-router\");\nconst Koa = require(\"koa\");\nconst Http = require(\"http\");\n\nconst app = new Koa();\n\nconst router = new KoaRouter({\n  prefix: \"/public\"\n});\n\nServe(`${__dirname}/public`, router);\n\napp.use(router.routes());\n\nconst server = Http.createServer(app.callback());\n\nserver.listen(1337, \"localhost\", () => {\n  console.log(\"Server started\");\n});\n```\n\n### See also\n[koa-static](https://github.com/koajs/static)  \n[koa-send](https://github.com/koajs/send)  \n[koa-router](https://github.com/ZijianHe/koa-router)\n\n### License\nMIT - Owen Calvin\n","readmeFilename":"README.md"}