auth rout
This commit is contained in:
+6
-3
@@ -1,8 +1,11 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
)
|
||||
import "net/http"
|
||||
|
||||
func Register() {
|
||||
func Register(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
}
|
||||
|
||||
func Login(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package initializers
|
||||
|
||||
import (
|
||||
"api/src/auth"
|
||||
"api/src/storages/psql"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
@@ -68,6 +69,11 @@ func InitChiRouting() {
|
||||
w.Write([]byte("welcome developer! Cool."))
|
||||
})
|
||||
|
||||
r.Route("/auth", func(r chi.Router) {
|
||||
r.Post("/register", auth.Register)
|
||||
r.Post("/loging", auth.Login)
|
||||
})
|
||||
|
||||
// up server on os.Getenv("SERVER_PORT") port on gorutin
|
||||
go func() {
|
||||
defer close(Done)
|
||||
|
||||
Reference in New Issue
Block a user