pronounsfu/backend/routes.go

33 lines
929 B
Go
Raw Normal View History

package backend
2022-05-02 08:19:37 -07:00
import (
"codeberg.org/pronounscc/pronouns.cc/backend/routes/v1/auth"
"codeberg.org/pronounscc/pronouns.cc/backend/routes/v1/bot"
"codeberg.org/pronounscc/pronouns.cc/backend/routes/v1/member"
"codeberg.org/pronounscc/pronouns.cc/backend/routes/v1/meta"
"codeberg.org/pronounscc/pronouns.cc/backend/routes/v1/mod"
"codeberg.org/pronounscc/pronouns.cc/backend/routes/v1/user"
user2 "codeberg.org/pronounscc/pronouns.cc/backend/routes/v2/user"
2023-06-03 07:18:47 -07:00
"codeberg.org/pronounscc/pronouns.cc/backend/server"
2022-05-02 08:19:37 -07:00
"github.com/go-chi/chi/v5"
2023-05-18 19:50:11 -07:00
_ "embed"
2022-05-02 08:19:37 -07:00
)
// mountRoutes mounts all API routes on the server's router.
// they are all mounted under /v1/
func mountRoutes(s *server.Server) {
s.Router.Route("/v1", func(r chi.Router) {
auth.Mount(s, r)
user.Mount(s, r)
member.Mount(s, r)
2022-06-17 06:49:16 -07:00
bot.Mount(s, r)
meta.Mount(s, r)
2023-03-19 08:14:09 -07:00
mod.Mount(s, r)
2022-05-02 08:19:37 -07:00
})
2023-05-18 19:50:11 -07:00
s.Router.Route("/v2", func(r chi.Router) {
user2.Mount(s, r)
})
2022-05-02 08:19:37 -07:00
}