2022-10-20 16:59:33 +00:00
|
|
|
package routes
|
|
|
|
|
|
|
|
import (
|
|
|
|
"GoWeb/app"
|
2024-07-02 02:19:48 +00:00
|
|
|
"GoWeb/app/controllers"
|
|
|
|
"GoWeb/app/middleware"
|
2022-10-20 16:59:33 +00:00
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2023-08-03 17:09:40 +00:00
|
|
|
// Post defines all project post routes
|
2024-07-02 02:19:48 +00:00
|
|
|
func Post(app *app.Deps) {
|
2022-11-04 20:12:57 +00:00
|
|
|
// Post controller struct initialize
|
2023-08-03 17:09:40 +00:00
|
|
|
postController := controllers.Post{
|
2022-10-20 16:59:33 +00:00
|
|
|
App: app,
|
|
|
|
}
|
|
|
|
|
2022-11-04 20:12:57 +00:00
|
|
|
// User authentication
|
2023-07-23 04:37:38 +00:00
|
|
|
http.HandleFunc("/register-handle", middleware.Csrf(postController.Register))
|
|
|
|
http.HandleFunc("/login-handle", middleware.Csrf(postController.Login))
|
2022-10-20 16:59:33 +00:00
|
|
|
}
|