{"id":15068281,"url":"https://github.com/1407arjun/file-router-express","last_synced_at":"2026-01-18T20:15:10.425Z","repository":{"id":37398045,"uuid":"504104436","full_name":"1407arjun/file-router-express","owner":"1407arjun","description":"React-Router based file-system routing for Express.js.","archived":false,"fork":false,"pushed_at":"2022-06-23T12:59:20.000Z","size":78,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-29T08:13:46.082Z","etag":null,"topics":["expressjs","file-routing","nodejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/file-router-express","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/1407arjun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-16T10:05:34.000Z","updated_at":"2023-06-10T18:36:17.000Z","dependencies_parsed_at":"2022-08-18T21:22:34.148Z","dependency_job_id":null,"html_url":"https://github.com/1407arjun/file-router-express","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/1407arjun/file-router-express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1407arjun%2Ffile-router-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1407arjun%2Ffile-router-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1407arjun%2Ffile-router-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1407arjun%2Ffile-router-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/1407arjun","download_url":"https://codeload.github.com/1407arjun/file-router-express/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/1407arjun%2Ffile-router-express/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28549752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T19:56:05.265Z","status":"ssl_error","status_checked_at":"2026-01-18T19:55:54.685Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expressjs","file-routing","nodejs"],"created_at":"2024-09-25T01:33:06.907Z","updated_at":"2026-01-18T20:15:10.396Z","avatar_url":"https://github.com/1407arjun.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# file-router-express\n\nReact-Router based file-system routing for Express.js.\n\n```sh\nnpm i file-router-express\n```\n\n## Usage\n\n### Quick start\n\n\u003e Note that the router is extension independent, i.e. `.js` and `.ts` files are treated the same.\n\n```js\nimport express from \"express\"\nimport router from \"file-router-express\"\n\nconst app = express()\napp.use(\"/\", router)\napp.listen(PORT)\n```\n\n### Routing\n\n```sh\nExamples:\nindex.js =\u003e /\nroute.js =\u003e /route\nroute1/route2.js =\u003e route1/route2\nroute1/[route2].js =\u003e route1/:route2 // { 'params': { route2 } }\nroute1/[route2]/[route3].js =\u003e route1/:route2/:route3 // { 'params': { route2, route3 } }\nroute1/[...route2].js =\u003e route1/*\n```\n\n### Handlers\n\n\u003e Named exports take higher preference over default exports\n\n```js\n// Named exports\nexport const get = (req, res, next) =\u003e {...} // Same as router.get('route', get)\nexport const post = (req, res, next) =\u003e {...} // Same as router.post('route', post)\n// .\n// .\nexport const del = (req, res, next) =\u003e {...} // Use 'del' instead of 'delete', same as router.delete('route', del)\n// .\n// .\n// .\n// Default export\nexport default (req, res, next) =\u003e {...} // Same as router.all('route', (req, res, next) =\u003e {...})\n```\n\n### Middlewares\n\n\u003e Export an array of middleware functions along with the handler instead of the handler alone.\n\n```js\n// Named exports\nexport const get = [middleware1, middleware2, ..., handler] // Same as router.get('route', middleware1, middleware2, ..., handler)\n// .\n// .\n// Default export\nexport default [middleware1, middleware2, ..., handler] // Same as router.all('route', middleware1, middleware2, ..., handler)\n```\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Read [CONTRIBUTING.md](CONTRIBUTING.md).\n\n1. Fork the project.\n2. Create your Feature Branch. (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes. (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch. (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1407arjun%2Ffile-router-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F1407arjun%2Ffile-router-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F1407arjun%2Ffile-router-express/lists"}