1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

examples: minor (see previous commits)

examples: 3rd-party sse (2):  add the same client-side as the original 3rd-party example
This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-01-27 04:51:53 +02:00
parent bccd5eb388
commit 61f04ee4ff
2 changed files with 27 additions and 2 deletions

View File

@@ -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))