auth rout

This commit is contained in:
valitovgaziz
2024-08-12 08:56:40 +05:00
parent 5cbb3237e0
commit c8bfe07fb3
2 changed files with 12 additions and 3 deletions
+6 -3
View File
@@ -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) {
}
+6
View File
@@ -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)