An open API service indexing awesome lists of open source software.

https://github.com/jchip/koa-stream-sample

koa streaming sample
https://github.com/jchip/koa-stream-sample

Last synced: 6 months ago
JSON representation

koa streaming sample

Awesome Lists containing this project

README

          

# koa-stream-sample

Install [fyn].

```bash
$ fyn
$ fun start
```

## routes

- `http://localhost:3000` - return streaming response
- `http://localhost:3000?fail=2` - cause a failure on 2nd streaming chunk
- `http://localhost:3000/multi` - send back multiple streams in response

> Note in `multi`, both streams were produced concurrently, so the second one show up in one go after the first one's streamed.

## Others

- [Hapi] -
- [express] -
- [fastify] -

# License

Licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)

---

[fyn]: https://www.npmjs.com/package/fyn
[hapi]: https://hapijs.com/
[express]: https://expressjs.com/
[fastify]: https://www.fastify.io/