{"id":18430479,"url":"https://github.com/connormckelvey/cloudflare-worker-router-typescript","last_synced_at":"2026-04-28T16:03:53.710Z","repository":{"id":57200769,"uuid":"467058277","full_name":"connormckelvey/cloudflare-worker-router-typescript","owner":"connormckelvey","description":"Cloudflare Workers Router is a lightweight Express-like router with middleware support Cloudflare Workers and Durable Objects. ","archived":false,"fork":false,"pushed_at":"2022-03-26T17:21:07.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T18:56:12.805Z","etag":null,"topics":["cloudflare","durable-objects","express","router","worker"],"latest_commit_sha":null,"homepage":"","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/connormckelvey.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}},"created_at":"2022-03-07T11:05:25.000Z","updated_at":"2024-04-06T01:43:05.000Z","dependencies_parsed_at":"2022-09-16T15:12:09.438Z","dependency_job_id":null,"html_url":"https://github.com/connormckelvey/cloudflare-worker-router-typescript","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connormckelvey%2Fcloudflare-worker-router-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connormckelvey%2Fcloudflare-worker-router-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connormckelvey%2Fcloudflare-worker-router-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connormckelvey%2Fcloudflare-worker-router-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/connormckelvey","download_url":"https://codeload.github.com/connormckelvey/cloudflare-worker-router-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794566,"owners_count":21162613,"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","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":["cloudflare","durable-objects","express","router","worker"],"created_at":"2024-11-06T05:20:56.988Z","updated_at":"2026-04-28T16:03:48.653Z","avatar_url":"https://github.com/connormckelvey.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare Worker Router\n\nCloudflare Workers Router is a lightweight Express-like router with middleware support Cloudflare Workers and Durable Objects. It began as a fork of [@tsndr/cloudflare-worker-router](https://github.com/tsndr/cloudflare-worker-router). The entire codebase has been converted to Typescript and a couple features have been added.\n\n- Websocket support, for Cloudflare's `Response` object\n- `router.use()`, for express-like global middleware\n- Separate Cors middleware\n\n## Usage\n\n`npm install cloudflare-worker-router`\n\n```typescript\nimport { Router, RouterRequest, RouterResponse } from 'cloudflare-worker-router-typescript'\n\nconst router = new Router()\n\ninterface Env {\n    FOO_OBJ: DurableObjectNamespace\n}\n\nrouter.get('/echo/:foo/:bar', async (req: RouterRequest\u003cEnv\u003e, res: RouterResponse) =\u003e {\n    console.log(req.env!.FOO_OBJ)\n    res.status = 200\n    res.body = { id: req.params }\n})\n\nexport default {\n    async fetch(req: Request, env: Env, ctx: ExecutionContext) {\n        return router.handle(req, env, ctx)\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnormckelvey%2Fcloudflare-worker-router-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnormckelvey%2Fcloudflare-worker-router-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnormckelvey%2Fcloudflare-worker-router-typescript/lists"}