{"id":30390077,"url":"https://github.com/kaibun/appwrite-fn-router","last_synced_at":"2026-05-15T21:06:15.849Z","repository":{"id":308256792,"uuid":"1032172632","full_name":"kaibun/appwrite-fn-router","owner":"kaibun","description":"A router for Appwrite’s FaaS","archived":false,"fork":false,"pushed_at":"2025-08-16T13:40:20.000Z","size":7007,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-16T15:29:05.004Z","etag":null,"topics":["appwrite","appwrite-function","itty","itty-router","micro-router"],"latest_commit_sha":null,"homepage":"https://appwrite-fn-router.appwrite.network/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaibun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-08-04T23:37:34.000Z","updated_at":"2025-08-05T15:14:41.000Z","dependencies_parsed_at":"2025-08-05T01:19:18.845Z","dependency_job_id":"c50c700f-01eb-4d4a-b366-26bd9ee52436","html_url":"https://github.com/kaibun/appwrite-fn-router","commit_stats":null,"previous_names":["kaibun/appwrite-fn-router"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kaibun/appwrite-fn-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaibun%2Fappwrite-fn-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaibun%2Fappwrite-fn-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaibun%2Fappwrite-fn-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaibun%2Fappwrite-fn-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaibun","download_url":"https://codeload.github.com/kaibun/appwrite-fn-router/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaibun%2Fappwrite-fn-router/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271455362,"owners_count":24762703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["appwrite","appwrite-function","itty","itty-router","micro-router"],"created_at":"2025-08-21T09:12:40.275Z","updated_at":"2026-05-15T21:06:15.845Z","avatar_url":"https://github.com/kaibun.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Appwrite Function Router\n\nThis library is a wrapper for [Itty’s `Router`](https://itty.dev/itty-router/concepts), tailored to the constraints of [Appwrite’s FaaS](https://appwrite.io/docs/products/functions/develop) implementation.\n\n## Usage\n\n```ts\nimport type { AppwriteContext, AppwriteResponseObject, JSONObject } from \"appwrite-fn-router\"\nimport { handleRequest } from \"appwrite-fn-router\";\nimport { myRouteHandler } from \"./routes\";\n\n// Optionally define a custom JSON response schema:\ntype MyJSONResponse = {\n  status: 'success' | 'error';\n  message: string;\n  error?: string;\n} \u0026 JSONObject;\n\n// This async function is your regular Appwrite’s mandatory function handler:\nexport default async (context: AppwriteContext) =\u003e {\n  // One may leverage Appwrite’s provided context properties if need be:\n  // const { req, res, log, error } = context;\n\n  // Those properties would be accessible from within the routes handlers thanks\n  // to the JavaScript closure, but one may import handlers from a file, so\n  // the best practice here is to  pass that context alongside your routes\n  // (defined using Itty’s API): the context is made available to the route\n  // handlers):\n  return handleRequest(context, (router) =\u003e {\n    // In a route handler, request is a native Request object, while req is the\n    // Appwrite’s specific request flavor. You also get access to the rest of\n    // Appwrite’s function’s context: res, log and error objects.\n    router.get('/hello', (request, req, res, log, error) =\u003e {\n      return res.json({\n        status: 'success',\n        message: 'Hello, world!',\n      }) satisfies AppwriteResponseObject\u003cMyJSONResponse\u003e;\n    });\n\n    router.post('/data', async (request, req, res, log, error) =\u003e {\n      const data = await req.bodyJson;\n      return res.json({\n        received: data,\n      });\n    });\n\n    // Despite being defined outside the closure, myRouteHandler still has\n    // access to the function’s context, through it’s params. How handy!\n    router.get(\"/mystery\", myRouteHandler);\n  });\n```\n\n## Local Development\n\n\u003e For instructions on how to set up a local development environment with hot-reloading, please see the [**Contributing Guide**](./doc/docs/contributing/index.md).\n\n### Overview\n\nMono-repo (TypeScript/Node.js): The main project is an npm library that provides a router for Appwrite Functions, built as a wrapper around Itty Router.\n\nOrganization: Multiple sub-projects, including core src code, documentation (Docusaurus), Appwrite test functions, OpenAPI schema, types, Cypress E2E tests, and more.\n\n### Folder Structure\n\n- src: Main source code (TypeScript, React components, utilities)\n- doc: Docusaurus documentation (custom theme, code examples, markdown docs)\n- functions: Appwrite test functions (npm workspace, TypeScript code)\n- openapi: OpenAPI schema and generation scripts\n- cypress: Cypress end-to-end tests\n- types: TypeScript type definitions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaibun%2Fappwrite-fn-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaibun%2Fappwrite-fn-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaibun%2Fappwrite-fn-router/lists"}