add releases page; fix HUGE static file perf regression
This commit is contained in:
parent
31fd5da44b
commit
065a34a744
20 changed files with 233 additions and 73 deletions
|
|
@ -16,21 +16,19 @@ func IndexHandler(app *model.AppState) http.Handler {
|
|||
return
|
||||
}
|
||||
|
||||
type IndexData struct {
|
||||
TwitchStatus *model.TwitchStreamInfo
|
||||
}
|
||||
|
||||
var err error
|
||||
var twitchStatus *model.TwitchStreamInfo = nil
|
||||
if app.Twitch != nil && len(app.Config.Twitch.Broadcaster) > 0 {
|
||||
twitchStatus, err = controller.GetTwitchStatus(app, app.Config.Twitch.Broadcaster)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "WARN: Failed to get Twitch status for %s: %v\n", app.Config.Twitch.Broadcaster, err)
|
||||
}
|
||||
}
|
||||
|
||||
if r.URL.Path == "/" || r.URL.Path == "/index.html" {
|
||||
err := templates.IndexTemplate.Execute(w, IndexData{
|
||||
type IndexData struct {
|
||||
TwitchStatus *model.TwitchStreamInfo
|
||||
}
|
||||
var err error
|
||||
var twitchStatus *model.TwitchStreamInfo = nil
|
||||
if app.Twitch != nil && len(app.Config.Twitch.Broadcaster) > 0 {
|
||||
twitchStatus, err = controller.GetTwitchStatus(app, app.Config.Twitch.Broadcaster)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "WARN: Failed to get Twitch status for %s: %v\n", app.Config.Twitch.Broadcaster, err)
|
||||
}
|
||||
}
|
||||
err = templates.IndexTemplate.Execute(w, IndexData{
|
||||
TwitchStatus: twitchStatus,
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue