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:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user