Simplified router code

This commit is contained in:
Eduard Urbach 2016-11-13 01:45:13 +09:00
parent f9424a79e4
commit e6c17a67c3

View File

@ -1,8 +1,6 @@
package main package main
import ( import (
"strconv"
"github.com/aerogo/aero" "github.com/aerogo/aero"
"github.com/animenotifier/arn" "github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components" "github.com/animenotifier/notify.moe/components"
@ -14,7 +12,7 @@ func init() {
}) })
app.Ajax("/anime/:id", func(ctx *aero.Context) string { app.Ajax("/anime/:id", func(ctx *aero.Context) string {
id, _ := strconv.Atoi(ctx.Get("id")) id, _ := ctx.GetInt("id")
anime, err := arn.GetAnime(id) anime, err := arn.GetAnime(id)
if err != nil { if err != nil {