{"id":15673447,"url":"https://github.com/jwebcoder/mith_router","last_synced_at":"2025-07-07T15:41:06.566Z","repository":{"id":57675368,"uuid":"265376766","full_name":"JWebCoder/mith_router","owner":"JWebCoder","description":"Routing system for Mith framework","archived":false,"fork":false,"pushed_at":"2020-08-12T03:21:03.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T08:08:32.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://doc.deno.land/https/deno.land/x/mith_router/mod.ts","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/JWebCoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"JWebCoder","patreon":"jwebcoder","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-05-19T21:55:57.000Z","updated_at":"2020-08-12T03:20:43.000Z","dependencies_parsed_at":"2022-09-26T18:20:41.248Z","dependency_job_id":null,"html_url":"https://github.com/JWebCoder/mith_router","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fmith_router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fmith_router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fmith_router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JWebCoder%2Fmith_router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JWebCoder","download_url":"https://codeload.github.com/JWebCoder/mith_router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246281216,"owners_count":20752207,"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":[],"created_at":"2024-10-03T15:40:37.221Z","updated_at":"2025-03-30T05:43:38.236Z","avatar_url":"https://github.com/JWebCoder.png","language":"TypeScript","funding_links":["https://github.com/sponsors/JWebCoder","https://patreon.com/jwebcoder"],"categories":[],"sub_categories":[],"readme":"# Mith_router\n\n![mith ci](https://github.com/JWebCoder/mith_router/workflows/mith%20router%20ci/badge.svg)\n[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/mith_router/mod.ts)\n\nRouting system to be used with the [Mith framework](https://github.com/JWebCoder/mith)\n\n## Usage\n\n**Basic integration with routing**\n```typescript\nimport { Mith } from 'https://deno.land/x/mith@v0.7.0/mod.ts'\nimport { Router } from 'https://deno.land/x/mith_router@v0.2.0/mod.ts'\nconst { env } = Deno\n\nconst router = new Router()\nconst innerRouter = new Router()\n\ninnerRouter.use(\n  'GET',\n  '/',\n  (req, res, next) =\u003e {\n    res.body.text = 'inner route'\n    next()\n  }\n)\n\nrouter.use(\n  'GET',\n  '/inner',\n  innerRouter.getRoutes()\n)\n\nrouter.use(\n  'GET',\n  '/',\n  (req, res, next) =\u003e {\n    res.body.text = 'something'\n    next()\n  }\n)\n\nconst app = new Mith()\n\napp.use(router.getRoutes())\n\nconst PORT = Number(env.get('PORT')) || 3000\napp.listen({ port: PORT})\nconsole.log('listening on', PORT)\n```\n\nRight now I'm still working on the documentation, so you can check the **example** folder for full usage examples\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwebcoder%2Fmith_router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwebcoder%2Fmith_router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwebcoder%2Fmith_router/lists"}