{"_id":"@andyburke/fs-fastify","_rev":"5-efe3443f62e5eaaf49e01406d1ba4c7b","name":"@andyburke/fs-fastify","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@andyburke/fs-fastify","version":"1.0.0","description":"Drive your fastify setup from the filesystem.","main":"index.js","scripts":{"test":"node test/tests.js"},"keywords":["fastify"],"author":{"name":"Andy Burke","email":"andy.burke@mailbox.earth"},"license":"ISC","dependencies":{"extend":"^3.0.2","globby":"^11.0.1"},"devDependencies":{"baretest":"github:andyburke-forks/baretest#tap"},"gitHead":"dd400f050c6fe4f05f7c78dd1ffca93f56060929","_id":"@andyburke/fs-fastify@1.0.0","_nodeVersion":"14.5.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-gUu298tgbJyvCYaBX/KJOjA88qvsPqHS8jINJTv/TSWpQNaw5BXEq8m4dxjioLjwnD1FyHDD1E34BPLi3pUFdg==","shasum":"8f0820e14803ac2fb078d5598941769bbfbe36c9","tarball":"https://registry.npmjs.org/@andyburke/fs-fastify/-/fs-fastify-1.0.0.tgz","fileCount":7,"unpackedSize":5121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB/bSCRA9TVsSAnZWagAARNwP/RDKly8dlV5e/2oHu5lN\ntY/lSK+6m2XiVGprIuWLCEf144nsxr3Wj3SD26L5CCKLZNEK7fGvHgQmccbI\nDegeqLFwWoBO0f+dIprTEZ8CBtIghCQkEZ8AOZJruV6gdGgLFlx0p1LyDPwF\nc0yZSHeder8or/W/EUljUVsNGApaaibSX/uLjsYqKVyEn70k2TOdNz9e7De7\nfe106XyYQxosNWaW0p1PjRGLKNQb8FuylB1r9njP2MHn7B2Dw6T/fa8/+/uj\nrPNofAZf/RmjjrCiCHw/kr+mRCoue/UIzN/qDKG1nAM1cz6v56xg9GDOodBM\nUmfHLznBKPr3EH0m9VxRp5qDkkFXg0QG93KEBbQNzXOQlNwCwCwLouoCRgGa\ncS4UT0T6k/+ypEbeQzoWmpPlH61/LiqFTpAoe+ZPyc3y1/RgZQW46y0QdSRP\nEGEsV2bHNOBMAjL+bWQ2oRwxq0gDAnEH4myYsEuufs7AkLtlMygXzPQEGyV0\neNFEgDklXnGK3J8bTPaCul7i3rMnUyYoHV/LWJ4m9iCmfssgQEE75IOoxSAK\nzGlcELuilA+qZ63OnkTypQ9ohTOay9h9kRsSqwFfEzql9QcGLnNB/zcvAn+o\nYbhNPD32UAQriVqPaJJNYk66KSktojFDzCjkyKZYpdmIHn24czRbOzaqjEdw\nkiGu\r\n=rNXC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZmb1eaWvPAQyY1BbRA9x3v/75oAD6Tz2R5ZAUUZ8mhAiEAqYbutlaNxmD2htrLVNaj1ROuQeDeA8o/eDRMIDGcSmI="}]},"maintainers":[{"name":"andyburke","email":"andy.burke@mailbox.earth"}],"_npmUser":{"name":"andyburke","email":"andy.burke@mailbox.earth"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-fastify_1.0.0_1594357457693_0.32026091539738233"},"_hasShrinkwrap":false},"1.0.1":{"name":"@andyburke/fs-fastify","version":"1.0.1","description":"Drive your fastify setup from the filesystem.","main":"index.js","scripts":{"test":"node test/tests.js"},"keywords":["fastify"],"author":{"name":"Andy Burke","email":"andy.burke@mailbox.earth"},"license":"ISC","dependencies":{"extend":"^3.0.2","globby":"^11.0.1"},"devDependencies":{"baretest":"github:andyburke-forks/baretest#tap"},"gitHead":"3a9493ce7882d125445215ae150ee363e4ea28d3","_id":"@andyburke/fs-fastify@1.0.1","_nodeVersion":"14.5.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-bMoLvKljSWnugDRkABzruD6ZmTZVz9x/+/MV208ImNnLsXtWUz2KIZMI/wlRAMsdlXlJf5oUsRNsCmyxbskrqQ==","shasum":"dd875e0dcf4ea4c686317128538141d632df1496","tarball":"https://registry.npmjs.org/@andyburke/fs-fastify/-/fs-fastify-1.0.1.tgz","fileCount":7,"unpackedSize":5139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB/lxCRA9TVsSAnZWagAAwM4QAIVvkm1SqWH7c4PTtV3b\nHXIL9jwBVOV0eJxmGeuoj8rcrILI/x1nDSpwG17NeOoj0QkYtRkNkoz+XbNd\ntffk4D8pVELj54MckEcbBmVUH6EUNzKKghdyouXFJ0vIyd8A9/y9QLQZxsbS\nvfd80pPGt+SUblTSOA9B17urUTDTA1Vn7Mnim1BC8jViWnB/fvANxbUxPrHp\nEskPQVCRT/BqFhQcHRSyYO7bgB5rqsXmusR8NaHESCZeWs/IFBDCNqrvUxGX\np1uIXCq3UdTG1vX1sTyIr7zM1LzCfjT5ge84q9IpvTRb11cTb/wqMUs+FFl2\nyoJ/ugBGpoVt9g3jNqQ9QUyoUt7e5htCur69j/ahABgPthRE8wjeWwZ2QzUF\nRZ30FmswnYOd0Slw1hsZchUNShZ26Yk+deIWmuGbd/WyelILo8xH5hR8z9Qu\nZYr+oDKcrfu+tVbRLaGl7JwxTcjU+U6sEzd133pl/4Sgi1XGAxotxcvbMcFo\nuseOSFVHlEbX6bPuwtZ0J1gFWPT1IKkt+iKPqFPaVQ+/dLYtO/Hpbb3QuH5b\nfpRnXdAid8mj+UbWkYKLDxx5dPnkn7Z7qIdgqCijlgwmTCQI42w4F1H57mpr\ncGuUji0ecdU8BP1LAalvjK2bUuCXe1+R1NcevOkoCwT7bHYaEvdcR4yx55wH\np92f\r\n=Np6W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpt3jNLw8OdUya6/RQh/GYOPLB8n0KLyS/w3iFx4bznwIhAJF2Eh4g8Fs/USzOttQfXzyeAMesufoKryWQI4lcAZfL"}]},"maintainers":[{"name":"andyburke","email":"andy.burke@mailbox.earth"}],"_npmUser":{"name":"andyburke","email":"andy.burke@mailbox.earth"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-fastify_1.0.1_1594358128831_0.9555666755334047"},"_hasShrinkwrap":false},"1.0.2":{"name":"@andyburke/fs-fastify","version":"1.0.2","description":"Drive your fastify setup from the filesystem.","main":"index.js","scripts":{"test":"node test/tests.js"},"keywords":["fastify"],"author":{"name":"Andy Burke","email":"andy.burke@mailbox.earth"},"license":"ISC","dependencies":{"extend":"^3.0.2","globby":"^11.0.1"},"devDependencies":{"baretest":"github:andyburke-forks/baretest#tap"},"gitHead":"e7e6dad3812fdfbf20facaccec325a2ec4e0fec9","_id":"@andyburke/fs-fastify@1.0.2","_nodeVersion":"14.5.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-+rzArAKAiOrTkLHSpk9xCt+5Ki2AysvXGeZ//KZHIvv0nywnY6pJv3KxVrg9kVQ7AP+YL+YgEAjremme+IQYpQ==","shasum":"56a7861d456b1a49a5f42543c2aee9e1b1595159","tarball":"https://registry.npmjs.org/@andyburke/fs-fastify/-/fs-fastify-1.0.2.tgz","fileCount":7,"unpackedSize":5220,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB/11CRA9TVsSAnZWagAAWw4QAJgzMLEqY9FKHnOKto0J\nBUZrNq1lJTf6xd7KcawtjDJkgJY7PWKLL90aik4wgYuToEDaetaT6Ps4n98Z\nu8YWATuvsHhwuV7w0xJA64hGXYYYWY5R+zlxAyMFzuexmrnffF8Nyf+h1V5G\n+pKIzwzahUNm3v3TZlGO2Es5ChCa7YQFvRIqVcAPXNDlDrm3PYlKLRHOOmka\n8ulakgCPgLVZmwGGLEUUu5N7YVhPaYgwahBfCxIpHx1GLd839vQaib/6PG9k\nIvcQC21TqtEfZ2nxnzItK8IaIixmEiOmBoE6Quq/z+Xn83eOB+yNHOXPeeRI\nWMqMKiAVXrBNJ+DdwDJvKFGP2bQMXppo9ynWvcYRijjd6LeGEc4zc8i+neIa\ny6U8Y1r2gNHwJ53PyAZo/YvDXHwFFRuRYGspZlNozmvR1+npzx+LShjFlffu\nwzhOAOgw3iT7/trse8R05rb4yK1I3oNjO2Mer3XodD7/iYXtRgBDcqRtDVTa\nIJVCE2WxqDwLuJDvjOoZtyvQMDm1Vu7LPE2WECJxQtXDlNaap6PTxIZ34eQr\n04JFkx7ESKBx03uBs5nbHjix8zF7JsiBavLH/geh+kzFVR6gLLwWDDoybhpr\n7kPAMsr6WzZA5jWJhNBphljfBJSHkVzNfVRXuQQf2e3TD+dv/sJ6AA9769SW\nG4be\r\n=gsJo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0vu7JGiUmiVJwntRdkBuZZOH1rSHOtOCxHS5cv9fitQIhAIRpgUkKNHCGvD2dylb70Rbf1fZLiHJvHOlwg+o/ma2K"}]},"maintainers":[{"name":"andyburke","email":"andy.burke@mailbox.earth"}],"_npmUser":{"name":"andyburke","email":"andy.burke@mailbox.earth"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-fastify_1.0.2_1594359157290_0.3543368448179032"},"_hasShrinkwrap":false},"1.1.0":{"name":"@andyburke/fs-fastify","version":"1.1.0","description":"Drive your fastify setup from the filesystem.","main":"index.js","scripts":{"test":"node test/tests.js"},"keywords":["fastify"],"author":{"name":"Andy Burke","email":"andy.burke@mailbox.earth"},"license":"ISC","dependencies":{"extend":"^3.0.2","globby":"^11.0.1"},"devDependencies":{"baretest":"github:andyburke-forks/baretest#tap"},"gitHead":"5e9ba704bdc40fa88bfebedb189d22ec0dd2b858","_id":"@andyburke/fs-fastify@1.1.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-+2upUGKnt+yr9h+aM0yhnFTq1T+siv0ovpljIVFr23et6bMwCiYSHp7V+l5mqO9utzg1X51p5g/x/xgtlqWNgw==","shasum":"03b8f4ded171cc480eb70ea3b3986bb4ed5415a0","tarball":"https://registry.npmjs.org/@andyburke/fs-fastify/-/fs-fastify-1.1.0.tgz","fileCount":7,"unpackedSize":5235,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQFG3CRA9TVsSAnZWagAAohgQAJrjTLLCIC1okf3gzb1r\nSm8dM7ijdmbmTIk/9qW/BkfTTbHvwEiZ6OetN5Sr6KCWBK4Y2HxKE9ep3ubs\ntrvU2oFiLPZMcw1BjXarEbfjh4+GN9tYUFzLFvbdaHLZ+C6mdyRlb3uZRHlw\nlzkzNlXYFTCVAICcG1GHkyh1Siv0Jh846ncn/EN5dqVF9R2ahsMh9CnKbiyU\nsZgMhYrO6ICTsx9cDMr5vkBCiUcmqjL2wuQq2MfZZFi56eoGat4+0GAyZLQG\nD6jGmUadaBu6S9aoxBNq9anrCTKHZ+27o3Zf7TcJ/VZv+ddlmBEtnGQ2pFla\nDn5LdOagGAeInWifi48xaEg0pXKTIFlibkaXwzFKiWtdtGbVMGH6dpqt5EDX\nDzSH5wCbAJALHeqBcBsYg2FqE4Hg5LSckpRyCMsGnZLFAdfvHCaC2p6Y+/V9\nrXy0EuRHKai2XBYM9pZ+VJB7upsRfaeaPzFS0xKKEeZeBaryZIBVcunD5Gl1\nZbQH6/316PJhD9ORqB0DILczSKQuv6ODlEvcJgxWPuJZCyK57itNjhF4Yqn9\nHyiiEgC/YwRrGveNHtfCaMQgCl+M9qgBsB4ZRGNSX/OJkF09nZgHL/S8cbOf\nUIdYrpwY2GkPDE7tFwg+2JZnsY4RIfN7nND+j5W0CIWqAXEIuCm5mZBY/8Lq\ng6kt\r\n=bN/t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/LKjSH127C6UPefkRpEYv9Een+ac/9F4E3vACFyUx6AiEA64HvavfUeL5x5K16oiNeuCi6OSxW7+SrzPr0FCSKjpE="}]},"maintainers":[{"name":"andyburke","email":"andy.burke@mailbox.earth"}],"_npmUser":{"name":"andyburke","email":"andy.burke@mailbox.earth"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-fastify_1.1.0_1598050742854_0.6951010779660383"},"_hasShrinkwrap":false},"1.1.1":{"name":"@andyburke/fs-fastify","version":"1.1.1","description":"Drive your fastify setup from the filesystem.","main":"index.js","scripts":{"test":"node test/tests.js"},"keywords":["fastify"],"author":{"name":"Andy Burke","email":"andy.burke@mailbox.earth"},"license":"ISC","dependencies":{"extend":"^3.0.2","globby":"^11.0.1"},"devDependencies":{"baretest":"github:andyburke-forks/baretest#tap"},"gitHead":"4c60da2316d960e75694852035d5c450b56c1ae0","_id":"@andyburke/fs-fastify@1.1.1","_nodeVersion":"14.8.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-79DrRnbSssnwyzH2Py/vZDx+clvEISZ526HA1c11g/CoTv6C3pc+1K/Xv7+GAqqBfJH2sxOTxB6oWrcFCgRXaw==","shasum":"93da53627cd8953b0df304733d4ea04055e92384","tarball":"https://registry.npmjs.org/@andyburke/fs-fastify/-/fs-fastify-1.1.1.tgz","fileCount":7,"unpackedSize":5312,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQGKNCRA9TVsSAnZWagAAxn4P/2AOIlnYSB2lg/VwmBdQ\nnc9xRfZwY2YEEXnm8Fg+y/7s8hOE/9yJsfbSmXVwgjXoTXd35iO+b6Ci+oXv\n22hUI53HNh2abXnTI3CAZVKsfLifzNFmIpwOYq7UKGGXx31naeEykJ37uwsU\nNNO3/FgJ08gpWXmarMU5d/ifHZP3bNS/GvagzBYhPO5pMhV2QzBSupSwtBIS\nAjsuOPUgWt0gZfdySsXmIpXLjGVsPn2fahVgymqa1i6+OHrZ6kMpxDnj4xes\nC8++HiS14tpgbx+f/5YmDwi2i/oSBgJ1ekGR9+gmD//yhn7nmQvJMKHkUtxw\nhzT7upX3rSCw6BfWRfqXKRcCq2d4rZbK10kpMYAh6l76C+uQhdC03h3Yfnnl\nS0X7cRrIMUwkz+J9WvGSzQfxollv/vp69lzyAXs7s4sYrQUCR062GjKyhAIQ\nxjKHOyDCWv+lgR9fhUzwgj43sstTjWGQOFKMsAcPg9w+D+UfG7c3ckXQW66a\n6XwiqeyseYmkg5SrJjBOFegtK4BN2Dm8F29Lrhi86cLFuOf8yYh1iMxWUhtx\nYsfwNkGHgbx6uPRJgz3sWrCcDYSHgraR3EP+xgPd29ygbhigHTyi8Z/F3/3A\npYvJIL91lJIYqClyzXRQ2gSIw6ztK+Ect5L7lJ1lpdYlhstoEYRC5YdejTkL\n1YKa\r\n=UHnt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+UCBOypDRcZ8hizpmheTVGdN/6zitMnlYooT9vdnXCAiEA1tfrAzojD1r/DX1V2R2NRrCIS0oN+2xrV4tpt1m+tjw="}]},"maintainers":[{"name":"andyburke","email":"andy.burke@mailbox.earth"}],"_npmUser":{"name":"andyburke","email":"andy.burke@mailbox.earth"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fs-fastify_1.1.1_1598055053090_0.0724290604117428"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-10T05:04:17.650Z","1.0.0":"2020-07-10T05:04:17.809Z","modified":"2022-04-04T14:04:36.484Z","1.0.1":"2020-07-10T05:15:28.982Z","1.0.2":"2020-07-10T05:32:37.391Z","1.1.0":"2020-08-21T22:59:02.993Z","1.1.1":"2020-08-22T00:10:53.245Z"},"maintainers":[{"name":"andyburke","email":"andy.burke@mailbox.earth"}],"description":"Drive your fastify setup from the filesystem.","keywords":["fastify"],"author":{"name":"Andy Burke","email":"andy.burke@mailbox.earth"},"license":"ISC","readme":"# fs-fastify\n\nA module to drive your fastify setup via the filesystem.\n\n## Example\n\n```javascript\nconst fastify = require( 'fastify' )( {\n\tlogger: true\n} );\nconst fs_fastify = require( '@andyburke/fs-fastify' );\n\nconst routes = await fs_fastify();\nfor ( const route of routes ) {\n\tfastify.route( route );\n}\n\nfastify.listen( 3000, function ( err, address ) {\n  if ( err ) {\n    fastify.log.error( err );\n    process.exit( 1 );\n  }\n  fastify.log.info( `server listening on ${address}` );\n} );\n\n```\n\nThis will load all files that match the required options and register them as\nroutes in your fastify server.\n\nFor example, you could lay out your files thusly:\n\n```\n./api\n\tfoo/\n\t\t:bar/\n\t\t\tGET.js\n\t\t:baz/\n\t\t\tPOST.js\n\t\tzip/\n\t\t\tPATCH.js\n```\n\nThis would create the following routes:\n\n```\nGET /foo/:bar\nPOST /foo/:baz\nPATCH /foo/zip\n```\n\n## Options\n\n### root = 'api'\n\nSets the root folder to find routes in. By default this is set to 'api'.\n\n### extensions = [ 'js', 'cjs' ]\n\nSets the extensions to search for.\n\n### methods = [ 'GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS' ]\n\nSets the methods to look for in the file tree. Defaults to all normal HTTP\nmethods.\n\n## Route Definitions\n\nYour routes should export either a single function, eg:\n\n```javascript\nmodule.exports = function ( request, reply ) {\n\treturn {\n\t\thello: \"world\"\n\t};\n};\n```\n\nOr you can export a fastify route object, eg:\n\n```javascript\nmodule.exports = {\n\t// you should omit the method, as it will be filled by fs-fastify based on\n\t// the filename\n\t// method: 'GET',\n\n\t// you should omit the url, as it will be filled by fs-fastify based on\n\t// the filename\n\t// url: '/',\n\t\n\tschema: {\n\t\tresponse: {\n\t\t\t200: {\n\t\t\t\ttype: 'object',\n\t\t\t\tproperties: {\n\t\t\t\t\thello: { type: 'string' }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\thandler: function (request, reply) {\n\t\treply.send( { hello: 'world' } )\n\t}\n};\n```\n","readmeFilename":"README.md"}