diff --git a/website/docs/recipes/file-upload.md b/website/docs/recipes/file-upload.md index 6852ab09..ddfe2efd 100644 --- a/website/docs/recipes/file-upload.md +++ b/website/docs/recipes/file-upload.md @@ -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 @@ -67,6 +69,8 @@ func main() { } ``` +## Client + `index.html` ```html diff --git a/website/docs/recipes/streaming-file-upload.md b/website/docs/recipes/streaming-file-upload.md index 88d7096a..8d9699fe 100644 --- a/website/docs/recipes/streaming-file-upload.md +++ b/website/docs/recipes/streaming-file-upload.md @@ -3,6 +3,8 @@ - Streaming multipart/form-data file upload - Multiple form fields and files +## Server + `server.go` ```go @@ -87,6 +89,8 @@ func main() { } ``` +## Client + `index.html` ```html diff --git a/website/docs/recipes/streaming-response.md b/website/docs/recipes/streaming-response.md index 8ce12d02..8c175ffa 100644 --- a/website/docs/recipes/streaming-response.md +++ b/website/docs/recipes/streaming-response.md @@ -3,6 +3,8 @@ - Send data as it is produced - Streaming JSON response with chunked transfer encoding +## Server + `server.go` ```go @@ -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} diff --git a/website/docs/recipes/websocket.md b/website/docs/recipes/websocket.md index 2fd41b38..b316e4dd 100644 --- a/website/docs/recipes/websocket.md +++ b/website/docs/recipes/websocket.md @@ -1,5 +1,7 @@ ## WebSocket +## Server + `server.go` ```go @@ -38,6 +40,8 @@ func main() { } ``` +## Client + `index.html` ```html @@ -79,5 +83,27 @@ func main() { ``` +## 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)