chang routing files palce
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package initializers
|
||||
|
||||
import (
|
||||
"api/src/admin"
|
||||
"api/src/auth"
|
||||
"api/src/rt/admin"
|
||||
"api/src/rt/auth"
|
||||
"api/src/rt/prf"
|
||||
"api/src/rt/srch"
|
||||
"log/slog"
|
||||
"os"
|
||||
"time"
|
||||
@@ -39,13 +41,15 @@ func InitChiRouting() {
|
||||
// public Routes
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Post("/signup", auth.Register) // register
|
||||
r.Post("/signin", auth.Login) // signin
|
||||
r.Post("/signin", auth.Login) // signin
|
||||
r.Get("/search", srch.Search)
|
||||
})
|
||||
|
||||
// Private Routes
|
||||
// Require Authentication
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(auth.AuthMiddleware)
|
||||
r.Get("/profile", prf.Profile)
|
||||
r.Get("/allUsers", admin.GetAllUser) // all users get
|
||||
})
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package prf
|
||||
|
||||
import "net/http"
|
||||
|
||||
func Profile(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package srch
|
||||
|
||||
import "net/http"
|
||||
|
||||
func Search(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user