{"id":26476804,"url":"https://github.com/aquaticcalf/file-system-api-router","last_synced_at":"2026-02-24T21:31:13.737Z","repository":{"id":282840016,"uuid":"949334062","full_name":"aquaticcalf/file-system-api-router","owner":"aquaticcalf","description":"a file based api wrapper for express","archived":false,"fork":false,"pushed_at":"2025-03-17T08:28:16.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T17:56:11.037Z","etag":null,"topics":["api","based","express","file"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/file-system-api-router","language":"JavaScript","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/aquaticcalf.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-16T08:01:20.000Z","updated_at":"2025-04-09T09:52:58.000Z","dependencies_parsed_at":"2025-03-17T08:36:57.206Z","dependency_job_id":"a6819abf-3223-4850-9eaf-0c632da58139","html_url":"https://github.com/aquaticcalf/file-system-api-router","commit_stats":null,"previous_names":["aquaticcalf/file-system-api-router"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aquaticcalf/file-system-api-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaticcalf%2Ffile-system-api-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaticcalf%2Ffile-system-api-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaticcalf%2Ffile-system-api-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaticcalf%2Ffile-system-api-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aquaticcalf","download_url":"https://codeload.github.com/aquaticcalf/file-system-api-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aquaticcalf%2Ffile-system-api-router/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29801021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T21:02:39.706Z","status":"ssl_error","status_checked_at":"2026-02-24T21:02:21.834Z","response_time":75,"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":["api","based","express","file"],"created_at":"2025-03-20T00:07:49.410Z","updated_at":"2026-02-24T21:31:13.723Z","avatar_url":"https://github.com/aquaticcalf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## file system api router\n\n### installation :\n\n```bash\nnpm install file-system-api-router\n```\n\n### usage in your app :\n\n```js\n// index.js\nimport express from 'express'\nimport { registerRoutes } from 'file-system-api-router'\n\nconst app = express()\napp.use(express.json())\n\n// automatically register API routes from the \"api\" folder\nawait registerRoutes(app, 'api');\n\nconst PORT = process.env.PORT || 3000\n\napp.listen(PORT, () =\u003e {\n  console.log(`server is running on port ${PORT}`)\n})\n```\n\n### file structure convention :\n\n```\napi/\n  users/\n    get.js              -\u003e GET /users\n    [userId]/\n      get.js            -\u003e GET /users/:userId\n      post.js           -\u003e POST /users/:userId\n  posts/\n    new/\n      post.js           -\u003e POST /posts/new\n    [postId]/\n      get.js            -\u003e GET /posts/:postId\n      put.js            -\u003e PUT /posts/:postId\n      delete.js         -\u003e DELETE /posts/:postId\n  hello/\n    index/\n      get.js            -\u003e GET /hello\n    [username]/\n      get.js            -\u003e GET /hello/:username\n```\n\n### features :\n\n1. automatically maps your file system structure to API endpoints\n2. supports dynamic parameters with `[param]` folder names\n3. supports method-specific endpoint files (e.g. `get.js`, `post.js`, etc.)\n4. supports nested routes and index routes for cleaner organization\n\n### for your API endpoint files :\n\n```js\n// api/users/[userId]/get.js\nexport default function getUser(req, res) {\n    const { userId } = req.params\n    res.json({ message: `fetching user with id ${userId}` })\n}\n\n// api/posts/[postId]/put.js\nexport default function updatePost(req, res) {\n    const { postId } = req.params\n    res.json({ message: `updating post with id ${postId}`, data: req.body })\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquaticcalf%2Ffile-system-api-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faquaticcalf%2Ffile-system-api-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faquaticcalf%2Ffile-system-api-router/lists"}