Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <[email protected]>
  • Loading branch information
vishr committed Jul 3, 2015
1 parent 10c44a6 commit d70ad0a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
4 changes: 4 additions & 0 deletions website/docs/recipes/file-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Use `req.ParseMultipartForm(16 << 20)` for manually parsing multipart form. It gives
us an option to specify the maximum memory used while parsing the request body.

## Server

`server.go`

```go
Expand Down Expand Up @@ -67,6 +69,8 @@ func main() {
}
```

## Client

`index.html`

```html
Expand Down
4 changes: 4 additions & 0 deletions website/docs/recipes/streaming-file-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
- Streaming multipart/form-data file upload
- Multiple form fields and files

## Server

`server.go`

```go
Expand Down Expand Up @@ -87,6 +89,8 @@ func main() {
}
```

## Client

`index.html`

```html
Expand Down
8 changes: 7 additions & 1 deletion website/docs/recipes/streaming-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
- Send data as it is produced
- Streaming JSON response with chunked transfer encoding

## Server

`server.go`

```go
Expand Down Expand Up @@ -53,9 +55,13 @@ func main() {
}
```

## Client

`curl localhost:1323`

```js
## Output

```sh
{"Altitude":-97,"Latitude":37.819929,"Longitude":-122.478255}
{"Altitude":1899,"Latitude":39.096849,"Longitude":-120.032351}
{"Altitude":2619,"Latitude":37.865101,"Longitude":-119.538329}
Expand Down
26 changes: 26 additions & 0 deletions website/docs/recipes/websocket.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## WebSocket

## Server

`server.go`

```go
Expand Down Expand Up @@ -38,6 +40,8 @@ func main() {
}
```

## Client

`index.html`

```html
Expand Down Expand Up @@ -79,5 +83,27 @@ func main() {
</html>
```

## Output

`Client`

```sh
Hello, Client!
Hello, Client!
Hello, Client!
Hello, Client!
Hello, Client!
```

`Server`

```sh
Hello, Server!
Hello, Server!
Hello, Server!
Hello, Server!
Hello, Server!
```

## [Source Code](https://github.com/labstack/echo/blob/master/recipes/websocket)

0 comments on commit d70ad0a

Please sign in to comment.