{"id":15797166,"url":"https://github.com/mfellner/koa-router-rx","last_synced_at":"2025-04-21T08:31:56.891Z","repository":{"id":57289467,"uuid":"75648424","full_name":"mfellner/koa-router-rx","owner":"mfellner","description":"Reactive router middleware for koa","archived":false,"fork":false,"pushed_at":"2017-02-05T11:41:53.000Z","size":98,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-10-12T00:23:54.254Z","etag":null,"topics":["koa","rxjs"],"latest_commit_sha":null,"homepage":null,"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/mfellner.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":"2016-12-05T17:12:45.000Z","updated_at":"2024-06-13T01:15:13.000Z","dependencies_parsed_at":"2022-09-20T06:50:43.616Z","dependency_job_id":null,"html_url":"https://github.com/mfellner/koa-router-rx","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfellner%2Fkoa-router-rx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfellner%2Fkoa-router-rx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfellner%2Fkoa-router-rx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mfellner%2Fkoa-router-rx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mfellner","download_url":"https://codeload.github.com/mfellner/koa-router-rx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249715680,"owners_count":21315058,"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":["koa","rxjs"],"created_at":"2024-10-05T00:04:35.047Z","updated_at":"2025-04-21T08:31:56.560Z","avatar_url":"https://github.com/mfellner.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# koa-router-rx \u0026nbsp; [![npm version](https://badge.fury.io/js/koa-router-rx.svg)](https://badge.fury.io/js/koa-router-rx) [![Build Status](https://travis-ci.org/mfellner/koa-router-rx.svg?branch=master)](https://travis-ci.org/mfellner/koa-router-rx) [![Coverage Status](https://coveralls.io/repos/github/mfellner/koa-router-rx/badge.svg?branch=master)](https://coveralls.io/github/mfellner/koa-router-rx?branch=master)\n\nRouter middleware for [koa 2.x](https://github.com/koajs/koa/tree/v2.x) based on [koa-router](https://github.com/alexmingoia/koa-router) and [rxjs](https://github.com/ReactiveX/rxjs).\n\n### Introduction\n\nkoa-router-rx is an extension of koa-router that supports functions of RxJS Observables instead of regular middleware. Those functions are called \"Epics\", a concept directly inspired by [redux-observable](https://github.com/redux-observable/redux-observable).\n\nAn Epic is a function that takes an Observable argument and returns an Observable:\n\n```javascript\n(observable: Observable\u003cA\u003e) =\u003e Observable\u003cB\u003e\n```\n\n### Usage\n\nkoa-router-rx works just like koa-router, except that it expects an Epic instead of a koa-style middleware:\n\n```javascript\nimport Koa from 'koa'\nimport RxRouter from '../lib'\n\nconst router = new RxRouter()\n\nrouter.get('/hello', observable =\u003e observable.mapTo('Hello!'))\n\napp.use(router.routes())\napp.listen(3333)\n```\n\nSee the [example](example) for more details.\n\n#### Caveats\n\n* [Named routes](https://github.com/alexmingoia/koa-router/tree/master/#named-routes) are not supported.\n* Passing [multiple Epics](https://github.com/alexmingoia/koa-router/tree/master/#multiple-middleware) is not supported.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfellner%2Fkoa-router-rx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmfellner%2Fkoa-router-rx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmfellner%2Fkoa-router-rx/lists"}