2022-10-20 16:59:33 +00:00
|
|
|
package routes
|
|
|
|
|
|
|
|
import (
|
|
|
|
"GoWeb/app"
|
|
|
|
"GoWeb/controllers"
|
2023-07-21 16:59:55 +00:00
|
|
|
"GoWeb/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
|
|
|
|
func Post(app *app.App) {
|
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
|
2024-02-12 20:46:26 +00:00
|
|
|
http.HandleFunc("POST /register-handle", middleware.Csrf(postController.Register))
|
|
|
|
http.HandleFunc("POST /login-handle", middleware.Csrf(postController.Login))
|
|
|
|
http.HandleFunc("POST /logout", middleware.Csrf(postController.Logout))
|
2022-10-20 16:59:33 +00:00
|
|
|
}
|