Better routes splitting

This commit is contained in:
2019-09-02 08:19:10 +09:00
parent d854ef3a6a
commit 1f9e4cab47
6 changed files with 38 additions and 24 deletions

View File

@ -0,0 +1,15 @@
package activityroutes
import (
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/pages/activity"
"github.com/animenotifier/notify.moe/utils/page"
)
// Register registers the page routes.
func Register(app *aero.Application) {
page.Get(app, "/activity", activity.Global)
page.Get(app, "/activity/from/:index", activity.Global)
page.Get(app, "/activity/followed", activity.Followed)
page.Get(app, "/activity/followed/from/:index", activity.Followed)
}

View File

@ -4,9 +4,11 @@ import (
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/pages/anime"
"github.com/animenotifier/notify.moe/pages/anime/editanime"
"github.com/animenotifier/notify.moe/pages/calendar"
"github.com/animenotifier/notify.moe/pages/episode"
"github.com/animenotifier/notify.moe/pages/genre"
"github.com/animenotifier/notify.moe/pages/genres"
"github.com/animenotifier/notify.moe/pages/statistics"
"github.com/animenotifier/notify.moe/utils/page"
)
@ -38,4 +40,11 @@ func Register(app *aero.Application) {
// Genres
page.Get(app, "/genres", genres.Get)
page.Get(app, "/genre/:name", genre.Get)
// Calendar
page.Get(app, "/calendar", calendar.Get)
// Statistics
page.Get(app, "/statistics", statistics.Get)
page.Get(app, "/statistics/anime", statistics.Anime)
}

View File

@ -52,8 +52,9 @@ func Register(app *aero.Application) {
// Post
app.Get("/api/post/:id/reply/ui", post.ReplyUI)
// Post
// Types
app.Get("/api/types", database.Types)
app.Get("/api/types/:type/all", database.Download)
// SoundTrack
app.Post("/api/soundtrack/:id/download", soundtrack.Download)

View File

@ -2,12 +2,9 @@ package coreroutes
import (
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/pages/activity"
"github.com/animenotifier/notify.moe/pages/calendar"
"github.com/animenotifier/notify.moe/pages/embed"
"github.com/animenotifier/notify.moe/pages/home"
"github.com/animenotifier/notify.moe/pages/login"
"github.com/animenotifier/notify.moe/pages/statistics"
"github.com/animenotifier/notify.moe/pages/terms"
"github.com/animenotifier/notify.moe/pages/welcome"
"github.com/animenotifier/notify.moe/utils/page"
@ -15,29 +12,9 @@ import (
// Register registers the page routes.
func Register(app *aero.Application) {
// Front page
page.Get(app, "/", home.Get)
// Login
page.Get(app, "/login", login.Get)
// Welcome
page.Get(app, "/welcome", welcome.Get)
// Activity
page.Get(app, "/activity", activity.Global)
page.Get(app, "/activity/from/:index", activity.Global)
page.Get(app, "/activity/followed", activity.Followed)
page.Get(app, "/activity/followed/from/:index", activity.Followed)
// Calendar
page.Get(app, "/calendar", calendar.Get)
// Statistics
page.Get(app, "/statistics", statistics.Get)
page.Get(app, "/statistics/anime", statistics.Anime)
// Legal stuff
page.Get(app, "/terms", terms.Get)
// Browser extension