mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-29 17:07:15 +02:00
create api skeleton.
This commit is contained in:
parent
fc3ee13f65
commit
5acd428dee
8 changed files with 50 additions and 0 deletions
40
internal/api/router.go
Normal file
40
internal/api/router.go
Normal file
|
@ -0,0 +1,40 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/chi"
|
||||
|
||||
// "demodesk/neko/internal/api/member"
|
||||
// "demodesk/neko/internal/api/room"
|
||||
)
|
||||
|
||||
func Mount(router *chi.Mux) {
|
||||
// all member routes
|
||||
router.Mount("/member", MemberRoutes())
|
||||
|
||||
// all room routes
|
||||
router.Mount("/room", RoomRoutes())
|
||||
}
|
||||
|
||||
func MemberRoutes() *chi.Mux {
|
||||
router := chi.NewRouter()
|
||||
|
||||
router.Get("/test", func(w http.ResponseWriter, r *http.Request) {
|
||||
//nolint
|
||||
w.Write([]byte("hello world"))
|
||||
})
|
||||
|
||||
return router
|
||||
}
|
||||
|
||||
func RoomRoutes() *chi.Mux {
|
||||
router := chi.NewRouter()
|
||||
|
||||
router.Get("/test", func(w http.ResponseWriter, r *http.Request) {
|
||||
//nolint
|
||||
w.Write([]byte("hello world"))
|
||||
})
|
||||
|
||||
return router
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue