{"_id":"@dword-design/express-mount-files","_rev":"3-ccdff5f0d64d6d1a438dbf91afac0ff1","name":"@dword-design/express-mount-files","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@dword-design/express-mount-files","version":"0.0.1","description":"An express middleware for registering routes through your filesystem","main":"src/index.js","engines":{"node":">=14.0.0"},"scripts":{"lint":"eslint '**/*.js'","test":"nyc --reporter=text ava","coverage":"nyc report --reporter=text-lcov | coveralls","release":"np"},"repository":{"type":"git","url":"git+https://github.com/rhumaric/express-mount-files.git"},"keywords":["express","express-plugin"],"author":{"name":"Romaric Pascal","email":"hello@romaricpascal.is"},"license":"MIT","bugs":{"url":"https://github.com/rhumaric/express-mount-files/issues"},"homepage":"https://github.com/rhumaric/express-mount-files#readme","devDependencies":{"@commitlint/cli":"^8.1.0","@commitlint/config-conventional":"^8.1.0","ava":"^2.4.0","consolidate":"^0.15.1","coveralls":"^3.0.6","eslint":"^6.2.1","eslint-config-defaults":"^9.0.0","eslint-config-prettier":"^6.1.0","eslint-plugin-node":"^9.1.0","eslint-plugin-prettier":"^3.1.0","express":"^4.17.1","husky":"^3.0.4","lint-staged":"^9.2.3","np":"^6.1.0","nunjucks":"^3.2.0","nyc":"^14.1.1","prettier":"^1.18.2","supertest":"^4.0.2"},"peerDependencies":{"express":"^4.17.1"},"dependencies":{"fast-glob":"^3.0.4"},"ava":{"files":["**/*.test.js"]},"publishConfig":{"access":"public"},"gitHead":"30869429b156f72e969670b1553dd8e462c56715","_id":"@dword-design/express-mount-files@0.0.1","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-kDpsj+i9qLsGqUqVBHWyCNkkuRqlEEBWydudEvvsBeUH+4FbNTS9ANyrNRzBZz7bsRAfrT7lkU5dKAWBCECDfw==","shasum":"9bb689cbdc2e282d837d3f3de1c5905058a65e62","tarball":"https://registry.npmjs.org/@dword-design/express-mount-files/-/express-mount-files-0.0.1.tgz","fileCount":60,"unpackedSize":25724,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYGO80QIJZwt9yu1WvD5uARTW7fWIv2Y/MVfmNIUaBAQIgZY/C2H7KcwQdONx+rDeYvhzjItcK1QBCOItlQZcowbY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjg14TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptBxAAoQH8/68P3YQu1lgDAuYeOrjsrqpf6VUgWYPxHTwkisXUwh3C\r\ntJjuxIhr5ndfhHh65wzZlpf+Ssd/i55vHXLRslw+JkRM2jovNK4F0eWou3pU\r\nLQpXbLPrDJp/boJmCIYN7cfSOU9IDXzbW26cBu+n4dsqRe6Txzs4t6MCoHp+\r\n4PD3mf4l5/Rrc/oaiJZVBXkKxMGjNZUJwiPACuJRRUrE/y2PCVIn0Dl46Fni\r\nxe2wjoT1fmTeCx1uD8LgACfAqBuBGaHKo1aGHXzU3dqI8Fmcn3DH6r1JslIp\r\nBH1HNNTkJePM4xwSuQqSI9bBE65pDb7UX5wta63PJfLH5JHsFQu6L3l0eM+O\r\nO2j0XW9ev8872SX7yfrprO0huIIsFtIQebVcuaImY9gaO838aDiRZh5HEMW/\r\nKSBR7ts9kNJX5hCnTv8ONxvdPwVIlz1GLRH1thBW9Iv5QXG6mb2IsarjhR/P\r\nKbKW3QZy4Q1Z01g1dPTrI5NUobKnzaPqqazrBy4a4n9BH+SCaLa9EvoNJE34\r\npqpWW1s1YRhshppXQimIPP+WQ7lpQ+FFYoMc/TT42nNzDZ5IMTTuwWe6Bwp8\r\nMGGtOKr71Uk1Yl2d6oWsj6nTWNkvMpXYOMTiQyenS64y1dDXByFY28X3Vx7X\r\n1NF0+7Pq9PtXI0okatAYg8H9oNL9wWPb/14=\r\n=Z3rH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dword-design","email":"info@sebastianlandwehr.com"},"directories":{},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/express-mount-files_0.0.1_1669553683565_0.7838955415606561"},"_hasShrinkwrap":false},"0.0.2":{"name":"@dword-design/express-mount-files","version":"0.0.2","description":"An express middleware for registering routes through your filesystem","main":"src/index.js","engines":{"node":">=14.0.0"},"scripts":{"lint":"eslint '**/*.js'","test":"nyc --reporter=text ava","coverage":"nyc report --reporter=text-lcov | coveralls","release":"np"},"repository":{"type":"git","url":"git+https://github.com/rhumaric/express-mount-files.git"},"keywords":["express","express-plugin"],"author":{"name":"Romaric Pascal","email":"hello@romaricpascal.is"},"license":"MIT","bugs":{"url":"https://github.com/rhumaric/express-mount-files/issues"},"homepage":"https://github.com/rhumaric/express-mount-files#readme","devDependencies":{"@commitlint/cli":"^8.1.0","@commitlint/config-conventional":"^8.1.0","ava":"^2.4.0","consolidate":"^0.15.1","coveralls":"^3.0.6","eslint":"^6.2.1","eslint-config-defaults":"^9.0.0","eslint-config-prettier":"^6.1.0","eslint-plugin-node":"^9.1.0","eslint-plugin-prettier":"^3.1.0","express":"^4.17.1","husky":"^3.0.4","lint-staged":"^9.2.3","np":"^6.1.0","nunjucks":"^3.2.0","nyc":"^14.1.1","prettier":"^1.18.2","supertest":"^4.0.2"},"peerDependencies":{"express":"^4.17.1"},"dependencies":{"fast-glob":"^3.0.4"},"ava":{"files":["**/*.test.js"]},"publishConfig":{"access":"public"},"gitHead":"cac23afd3604d0a11173d79e900b01421c3a8bcc","_id":"@dword-design/express-mount-files@0.0.2","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-csXWzTZwlHeIGfSzK6pKCsAqjvviXiFMVExOg2qHL4+Jy75q8Y8FqL1tK6yCWI8I8Ozv/25UMcuqKWJHloifdA==","shasum":"47718c6285243129d21ed96bd15a016f83fd9bbd","tarball":"https://registry.npmjs.org/@dword-design/express-mount-files/-/express-mount-files-0.0.2.tgz","fileCount":60,"unpackedSize":25778,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICeCI9p363xyCWsB3XdwlFhWHhwmbCF3eHsGNpuVw1o8AiAj/8AclRthELIXIvB8mUJgGFUVQMFl3nP3EzSPUt6RCg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJji3DsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrd4Q//Xbl+Q4niTzYAA667q/cytNI9po5Uh4FiS+bQwGrUBCNCYvaz\r\n1dqLoKr0RdSUlnNX4Tw4QYP6czwEv365i9I+wd1sVyFdfoPgbrYzNwJ2/h+i\r\nZu/xX4e6wMkV0cR3WIHU7nVmytAhWc99n47WRG7tv56c5EahHHka/6vlY41Y\r\nwjE6pIWbLvIKooi0tLu4lRpxPcDWiycfU+A8MN4RlP/ddcuzr4dGQ/lLOdG/\r\nYic6+YOiIxeX3NJrEswJ1V72E0hF6osWo/t5Ptk8tja8xRahyFdfVboDIu2D\r\nHZHjo9anAAY8MP1o6arGVyYp0TTh52tAnsB1NbAH55cdxoo4pA9uwV3+2gm4\r\nnjMyL8z32Ju+Oa72hjqnirXGQLDArCFCSfU6LnhXtfd2pZqKfIWH537fqcTn\r\nxqJ8v81FpPVrODc/rngcKL6Pm3gsksQDQCaafd+n4yZgU2SiwCaHkQxFvlIf\r\ncM440tNwsOZbRTsXZZh4SeRLI/J5XjseU5K2p0YiAQ9WqlkBZu9kfbVCoBxa\r\n5Q4z0TijCOJwuDOzYfdK3O2OZLHUQo1jigCjW00fdedILJTWkowdxvpCWkgp\r\nMco7qRVpjhR3a0lzFkndGJ84rynKabMlcyERNJli88QNGJdqQ2pXO2Kaa3JO\r\nuKN5VULnOwDt5955nXmYzRzKwyA0/PQkYMI=\r\n=YyDp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dword-design","email":"info@sebastianlandwehr.com"},"directories":{},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/express-mount-files_0.0.2_1670082796060_0.5034175269984396"},"_hasShrinkwrap":false},"0.0.3":{"name":"@dword-design/express-mount-files","version":"0.0.3","description":"An express middleware for registering routes through your filesystem","main":"src/index.js","engines":{"node":">=8.12.0"},"scripts":{"lint":"eslint '**/*.js'","test":"nyc --reporter=text ava","coverage":"nyc report --reporter=text-lcov | coveralls","release":"np"},"repository":{"type":"git","url":"git+https://github.com/rhumaric/express-mount-files.git"},"keywords":["express","express-plugin"],"author":{"name":"Romaric Pascal","email":"hello@romaricpascal.is"},"license":"MIT","bugs":{"url":"https://github.com/rhumaric/express-mount-files/issues"},"homepage":"https://github.com/rhumaric/express-mount-files#readme","devDependencies":{"@commitlint/cli":"^8.1.0","@commitlint/config-conventional":"^8.1.0","ava":"^2.4.0","consolidate":"^0.15.1","coveralls":"^3.0.6","eslint":"^6.2.1","eslint-config-defaults":"^9.0.0","eslint-config-prettier":"^6.1.0","eslint-plugin-node":"^9.1.0","eslint-plugin-prettier":"^3.1.0","express":"^4.17.1","husky":"^3.0.4","lint-staged":"^9.2.3","np":"^6.1.0","nunjucks":"^3.2.0","nyc":"^14.1.1","prettier":"^1.18.2","supertest":"^4.0.2"},"peerDependencies":{"express":"^4.17.1"},"dependencies":{"fast-glob":"^3.0.4","jiti":"^1.16.0"},"ava":{"files":["**/*.test.js"]},"publishConfig":{"access":"public"},"gitHead":"b4241fbf178aadf6855726692e7d25424b27556f","_id":"@dword-design/express-mount-files@0.0.3","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-bu315MHj2TNFEI1r11y8Mo14A/+mq4PpnxOJCYBcMDA6iaW/hfDL9qIF98kTi7SCZ8xn3I2dxR+3Bs4Z97ufHQ==","shasum":"b3c89d092867dd8efbe904df4d68b52daad1259a","tarball":"https://registry.npmjs.org/@dword-design/express-mount-files/-/express-mount-files-0.0.3.tgz","fileCount":60,"unpackedSize":25930,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMIxGtMJ0EjVRnR3GNBVh+BE5L/HtBWVAOxAWIC/O5UAiA+cLuUb02K/upV/hIKQVPlo/qBcaQz1ohYfZohwfMDow=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjBAnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoD3RAAmgfYD2lLHeINHs8CqzuIpZBPdhKoSFCCB5WtyWcq5xWC+ula\r\nJaGd0PJwQo7IMXi+Rc5zZmk873zq1IUMS9qN4F0gamllMQ4B9Z621Whwr9ZR\r\nfADaemh4iznilV7JA/QnLYo8mlx+Ro6ximcPw/BKKozMkdzy7maWn6ZP2tAe\r\nGS5EROM1v+Y5h0VX0FsCrhSTA/Mb/YlwJvUP4ZrVkELqlegiZcEShsEO1dyU\r\nnmQTYJ523Ildv6NtFS8DEsxVueL3spIxpztOXaidLuGtk/rJe4Kvs68511fh\r\neGIgfiaNBMBC6Os5XuvgOgaA7x2mPjZcJpFs52YHycnPjsI/OTo8dVzi3Pp3\r\n/KtCNe4Y6m2PuFNu+lANiLeT3zm0rhvkeLw/N6ePY8dOYLv/frFNGrVtC/+E\r\nyTji5bA4PnHeMdk/s/yBKufJxdW1rEALWzbLPMma/JRh1gJ7CH3V5xEQBTjQ\r\nTniq9hU++uxk6HIPnFrMi3Kofn3rDnrB8OAQi4uYVbwtBMArK9TtnSivUZcQ\r\na2yPF9rt8nPebyNM/1PXd3VwjWw/aVBGz9RMIE2SalM0b2qllcP/TGTRPvvk\r\ngNnFarEnfmqRnB4zwc5ZgdIt7f/5qpGJ7rLmJgFZP2UhSXTb2fcUvOXZfYNp\r\nWZBZuMOtP25gLjfaRx+kR4AcXfUHfOZ17Bk=\r\n=fQUM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dword-design","email":"info@sebastianlandwehr.com"},"directories":{},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/express-mount-files_0.0.3_1670123559720_0.8263450225445328"},"_hasShrinkwrap":false},"0.0.4":{"name":"@dword-design/express-mount-files","version":"0.0.4","description":"An express middleware for registering routes through your filesystem","main":"src/index.js","engines":{"node":">=8.12.0"},"scripts":{"lint":"eslint '**/*.js'","test":"nyc --reporter=text ava","coverage":"nyc report --reporter=text-lcov | coveralls","release":"np"},"repository":{"type":"git","url":"git+https://github.com/rhumaric/express-mount-files.git"},"keywords":["express","express-plugin"],"author":{"name":"Romaric Pascal","email":"hello@romaricpascal.is"},"license":"MIT","bugs":{"url":"https://github.com/rhumaric/express-mount-files/issues"},"homepage":"https://github.com/rhumaric/express-mount-files#readme","devDependencies":{"@commitlint/cli":"^8.1.0","@commitlint/config-conventional":"^8.1.0","ava":"^2.4.0","consolidate":"^0.15.1","coveralls":"^3.0.6","eslint":"^6.2.1","eslint-config-defaults":"^9.0.0","eslint-config-prettier":"^6.1.0","eslint-plugin-node":"^9.1.0","eslint-plugin-prettier":"^3.1.0","express":"^4.17.1","husky":"^3.0.4","lint-staged":"^9.2.3","np":"^6.1.0","nunjucks":"^3.2.0","nyc":"^14.1.1","prettier":"^1.18.2","supertest":"^4.0.2"},"peerDependencies":{"express":"^4.17.1"},"dependencies":{"fast-glob":"^3.0.4","jiti":"npm:@dword-design/jiti@^0.0.1"},"ava":{"files":["**/*.test.js"]},"publishConfig":{"access":"public"},"gitHead":"f5c6abaa780437ae611ca5b39bc2968804c991c1","_id":"@dword-design/express-mount-files@0.0.4","_nodeVersion":"16.18.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-vzhzvM7exQk6Rkntvq5mreq/+e5/vjROhuz2qN+UoEHl65HyR+tH56LQej514qJtULv2GBLJv+vOlolH6u7d7g==","shasum":"b6e3c6d322f80560a6b1dbb1e9c9af8a6c283ccf","tarball":"https://registry.npmjs.org/@dword-design/express-mount-files/-/express-mount-files-0.0.4.tgz","fileCount":60,"unpackedSize":25952,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLHc7AMsuHv0BJdvhjndJ/kYxV+4FlgWdTSNIWjnaSqAIgLeSAp6PgPu3OtszHMNxLitOFYUuiYRbd1kOIbjca1RM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjjgezACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpb4w/9GAQLndfXLBUk/yiXWTh3pm5gvzZ42i/RsJL2JB3Iw+Y26iVm\r\nKmt/0EHfRBFgg8qyTir3rLWrg0VmRC3bCKcgvCVJwlq+xLpX0w5fknefa121\r\n8/izeRBfH37HbjXbiG/U4/zXVVqW5TfCwlInZiOgyXKpviGIoaZmem9bKvk/\r\n5YSYWJ/4Pa8Mlxfzpj198E3atR60ZeFSD7F3BXFZHXM2SUH0OiCwhoPbIb3c\r\nKgxziSb9GFVb1VLp0vRwobWvw4sqOEuWpiv8bBVa5IBQhr9HXfk3YiiTaxOS\r\nysNg/Gz2a6KYbIQSCCLVKRiM8Yqqqiv0lZMjAtfg4QRyXLFD0qFJCq9ZmNuU\r\nADgZ9j5LX4/GRzG7+UhS3N7ycWaO/rKAzf7lXnXNZ6DJDsC6CkkzDjJR5MQd\r\n5p/vT5St/mfUX7O6bS8hO3hHcdmHXhLiPPlpS9w/bs26r1CSt7IHXSbI0AsO\r\nNzSvUEqTlL1A8L3NvQLq26VhMyk5fV/Wb/fM6vsY0sZIVLD8eyswyytM3c1n\r\n0mFSN6IvE2dDEoJ0dFShx6IYqbQyeZ8+Oqkw+9khGFKgiC9sE6t1MkuvVmgV\r\nvZT1vovDjt2kusjk3xUd8uJuQF7fA5yMnKiYQLCgKZ34uiHXoBZFL7DlklZI\r\n7VzOqjHWIkKopZcJ9K2/ODNh09dGwKwyJMY=\r\n=YtRg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dword-design","email":"info@sebastianlandwehr.com"},"directories":{},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/express-mount-files_0.0.4_1670252467068_0.9129522571347157"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-27T12:54:43.504Z","0.0.1":"2022-11-27T12:54:43.749Z","modified":"2022-12-05T15:01:07.476Z","0.0.2":"2022-12-03T15:53:16.231Z","0.0.3":"2022-12-04T03:12:39.950Z","0.0.4":"2022-12-05T15:01:07.360Z"},"maintainers":[{"name":"dword-design","email":"info@sebastianlandwehr.com"}],"description":"An express middleware for registering routes through your filesystem","homepage":"https://github.com/rhumaric/express-mount-files#readme","keywords":["express","express-plugin"],"repository":{"type":"git","url":"git+https://github.com/rhumaric/express-mount-files.git"},"author":{"name":"Romaric Pascal","email":"hello@romaricpascal.is"},"bugs":{"url":"https://github.com/rhumaric/express-mount-files/issues"},"license":"MIT","readme":"# express-mount-files\n\n[![Travis CI - Build Status](https://travis-ci.org/rhumaric/express-mount-files.svg?branch=master)](https://travis-ci.org/rhumaric/express-mount-files)\n[![Appveyor - Build status](https://ci.appveyor.com/api/projects/status/r2kkx586wajvfm7q/branch/master?svg=true)](https://ci.appveyor.com/project/rhumaric/express-mount-files/branch/master)\n[![Coverage Status](https://coveralls.io/repos/github/rhumaric/express-mount-files/badge.svg?branch=master)](https://coveralls.io/github/rhumaric/express-mount-files?branch=master)\n\nAn express middleware that lets you match your folder structure to your app's URL structure.\nDeclare routes by creating files at the path you want them to handle requests for, helping identify which bit of the app is handling a request hitting a specific URL.\n\n## Getting started\n\nAdd the middleware to your express app, passing the folder that'll contain your routes.\n\n```js\nconst mw = require('express-mount-files');\n// Use the routes folder as the root for all your routes\napp.use(mw('routes'))\n```\n\nIn that `routes` folder, create files ending with `<http_method>.js` and exporting the function that will handle the request. You can use any of the HTTP methods supported by Express. They need to be in **lowercase** in the file name, though.\n\nFor example, the following code in <code>routes/hello/world<strong>.get.js</strong></code> will make GET requests to `/hello/world` respond with 'Hello world'.\n\n```js\nmodule.exports = function(req,res) {\n  res.send('Hello world')\n}\n```\n\nThe middleware also support files that don't have any part before their `<http_method>.js` extension. For example 'routes/hello/get.js' will respond to `GET` requests sent to `/hello`.\n\n### Mounting order\n\nDeeper routes will be mounted first ensuring requests don't get swallowed by shallow routes being mounted ahead.\n\n## Template rendering\n\nIf a specific URL only needs to render a template, you can create files ending with `<http_method>.<template_extension>` to declare routes the same way as for JavaScript function.\n\nFor this to happen, you'll need to:\n\n- [configure Express to render use the templating engine of your choice](express-templating-engine)\n- let the middleware know which extension those templates are using, via its `viewExtensions` option.\n  As Express allows multiple template engines, this option accepts an `Array`.\n\n  ```js\n    // Provided `pug` has been registered as a view engine for Express\n    const mw = require('express-mount-files');\n    app.use(mw('routes', {viewExtensions: ['pug']}))\n  ```\n\nWith that in place, the `routes/time.get.pug` template will render for requests hitting `/time`.\n\n### Mounting order\n\nFor a same path, JavaScript routes will always be mounted before template routes. This lets you take advantage of Express' `next()` function to:\n\n- prepare the data in a JavaScript route, say the `greeting.get.js` file\n\n  ```js\n  module.exports = function(req,res,next) {\n    res.locals.greeting = 'Howdy!';\n  }\n  ```\n\n- render the response in `greeting.get.pug` template\n\n  ```js\n  h1 #{res.locals.greeting} world!\n  ```\n\n## Route parameters\n\nExpress allows parts of routes starting in `:` to be intepreted as [parameters for the requests](express-route-parameters), later available in the `req.params` object. This middleware provides the same feature, with one little tweak, it uses the `$` character instead of `:` (`:` didn't feel that safe to put in a file/folder name).\n\nThis way, the file at `routes/users/$userId/edit.get.js` will get `12` for `req.params.userId` when responding to `/users/12/edit`.\n\n### Mounting order\n\nFor routes with the same depth (say `/users/$userId/edit.get.js` and `/users/me/edit.get.js`), the routes with the most variables will be mounted last, leaving the more specific routes to match first.\n\n## Mounting middlewares\n\nexpress-mount-files also lets you  set up middlewares of specific routes. It'll look for `routes.js` files exporting an `Array` of functions to be registered as middlewares.\n\nThe following `routes/middlewares/routes.js` will register two functions to be used as middlewares for requests hitting `routes/middlewares`.\n\n```js\nmodule.exports = [function(req,res, next){\n  next()\n}, function(req,res,next) {\n  next()\n}];\n```\n\n### Mounting order\n\nThe middlewares in those `routes.js` files are always mounted **before** the JavaScript and view routes.\nThis means middlewares will run for all the routes within the folder. Contrary to the routes, though, middlewares will be mounted deepest last. This allows middlewares declared closest to the root to apply before the ones declared deeper.\n\n## Declaring middlewares and routes simmultaneously\n\nThe `routes.js` files can also export a hash, in which case they will be used to register:\n\n- middlewares declared in their `use` key\n- routes declared in any `<http_method>` key\n\nFor example, this `routes.js` file will mount:\n\n- 1 function as middleware,\n- two routes to handle the GET and POST requests hitting the path of the folder:\n\n```js\nmodule.exports = {\n  use: [function(req,res,next) {\n    next()\n  }],\n  get(req,res) {\n    res.send('GET')\n  },\n  post(req,res) {\n    res.send('POST')\n  }\n}\n```\n\n### Mounting order\n\nThe middlewares will be mounted in the same order as when exporting an `Array`. Routes will follow the same order as when using `<http_method>.js` files.\n\n## Folder separator\n\nThe middleware replaces any double underscore (`__`) as a directory separator. This should be used sparingly, but can help preventing to create nested folders for a single route file.\n\n[express-templating-engine]: https://expressjs.com/en/guide/using-template-engines.html\n[express-route-parameters]: https://expressjs.com/en/guide/routing.html#route-parameters\n","readmeFilename":"README.md"}