Skip to content

Commit

Permalink
Merge pull request #38 from DenisFrezzato/stream
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisFrezzato authored Jun 2, 2021
2 parents ddcf62e + 4f9b54f commit 48adfbf
Show file tree
Hide file tree
Showing 8 changed files with 736 additions and 57 deletions.
11 changes: 11 additions & 0 deletions docs/modules/express.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Added in v0.5.0
- [setHeader (method)](#setheader-method)
- [setStatus (method)](#setstatus-method)
- [setBody (method)](#setbody-method)
- [pipeStream (method)](#pipestream-method)
- [endResponse (method)](#endresponse-method)
- [\_S (property)](#_s-property)
- [fromRequestHandler](#fromrequesthandler)
Expand Down Expand Up @@ -184,6 +185,16 @@ setBody(body: unknown): ExpressConnection<ResponseEnded>

Added in v0.5.0

### pipeStream (method)

**Signature**

```ts
pipeStream(stream: Readable): ExpressConnection<ResponseEnded>
```

Added in v0.6.2

### endResponse (method)

**Signature**
Expand Down
14 changes: 14 additions & 0 deletions docs/modules/index.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Added in v0.5.0
- [middleware](#middleware)
- [modifyConnection](#modifyconnection)
- [orElse](#orelse)
- [pipeStream](#pipestream)
- [redirect](#redirect)
- [right](#right)
- [rightIO](#rightio)
Expand Down Expand Up @@ -129,6 +130,7 @@ export interface Connection<S> {
readonly setHeader: (this: Connection<HeadersOpen>, name: string, value: string) => Connection<HeadersOpen>
readonly setStatus: (this: Connection<StatusOpen>, status: Status) => Connection<HeadersOpen>
readonly setBody: (this: Connection<BodyOpen>, body: unknown) => Connection<ResponseEnded>
readonly pipeStream: (this: Connection<BodyOpen>, stream: Readable) => Connection<ResponseEnded>
readonly endResponse: (this: Connection<BodyOpen>) => Connection<ResponseEnded>
}
```
Expand Down Expand Up @@ -908,6 +910,18 @@ export declare function orElse<E, I, O, M, A>(

Added in v0.5.0

## pipeStream

Returns a middleware that pipes a stream to the response object.

**Signature**

```ts
export declare function pipeStream<E>(stream: Readable): Middleware<BodyOpen, ResponseEnded, E, void>
```

Added in v0.6.2

## redirect

Returns a middleware that sends a redirect to `uri`
Expand Down
Loading

0 comments on commit 48adfbf

Please # to comment.