auth rout
This commit is contained in:
+6
-3
@@ -1,8 +1,11 @@
|
|||||||
package auth
|
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
|
package initializers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"api/src/auth"
|
||||||
"api/src/storages/psql"
|
"api/src/storages/psql"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
@@ -68,6 +69,11 @@ func InitChiRouting() {
|
|||||||
w.Write([]byte("welcome developer! Cool."))
|
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
|
// up server on os.Getenv("SERVER_PORT") port on gorutin
|
||||||
go func() {
|
go func() {
|
||||||
defer close(Done)
|
defer close(Done)
|
||||||
|
|||||||
Reference in New Issue
Block a user