From 61f04ee4ff512af055074d745ff946cfc59f63ae Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Wed, 27 Jan 2021 04:51:53 +0200 Subject: [PATCH] examples: minor (see previous commits) examples: 3rd-party sse (2): add the same client-side as the original 3rd-party example --- .../sse-third-party-2/index.html | 23 +++++++++++++++++++ .../response-writer/sse-third-party-2/main.go | 6 +++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 _examples/response-writer/sse-third-party-2/index.html diff --git a/_examples/response-writer/sse-third-party-2/index.html b/_examples/response-writer/sse-third-party-2/index.html new file mode 100644 index 00000000..202d8a65 --- /dev/null +++ b/_examples/response-writer/sse-third-party-2/index.html @@ -0,0 +1,23 @@ + + + + SSE Examples + + + Messages +
+
+ + + + diff --git a/_examples/response-writer/sse-third-party-2/main.go b/_examples/response-writer/sse-third-party-2/main.go index eb9f83ca..3cba7c28 100644 --- a/_examples/response-writer/sse-third-party-2/main.go +++ b/_examples/response-writer/sse-third-party-2/main.go @@ -11,8 +11,10 @@ import ( "github.com/kataras/iris/v12" ) -// Install the sse third-party package +// Install the sse third-party package. // $ go get -u github.com/alexandrevicenzi/go-sse +// +// Documentation: https://pkg.go.dev/github.com/alexandrevicenzi/go-sse func main() { s := sse.NewServer(&sse.Options{ // Increase default retry interval to 10s. @@ -35,7 +37,7 @@ func main() { app := iris.New() app.Get("/", func(ctx iris.Context) { - ctx.ServeFile("../static/index.html") + ctx.ServeFile("./index.html") }) app.Get("/events/{channel}", iris.FromStd(s))