Implemented server sent events

This commit is contained in:
2018-11-07 05:40:03 +09:00
parent 61454b3e5b
commit e56782d5a3
6 changed files with 81 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"strings"
"github.com/animenotifier/notify.moe/pages/post"
"github.com/animenotifier/notify.moe/pages/sse"
"github.com/animenotifier/notify.moe/pages/thread"
"github.com/aerogo/aero"
@ -42,6 +43,9 @@ func Register(l *layout.Layout, app *aero.Application) {
app.Get("/api/next/soundtrack", soundtrack.Next)
app.Get("/api/character/:id/ranking", character.Ranking)
// Live updates
app.Get("/api/sse/events", sse.Events)
// Thread
app.Get("/api/thread/:id/reply/ui", thread.ReplyUI)