create api skeleton.

This commit is contained in:
Miroslav Šedivý 2020-10-29 22:23:30 +01:00
parent fc3ee13f65
commit 5acd428dee
8 changed files with 50 additions and 0 deletions

40
internal/api/router.go Normal file
View 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
}