2022-10-20 16:59:33 +00:00
|
|
|
package routes
|
|
|
|
|
|
|
|
import (
|
|
|
|
"GoWeb/app"
|
|
|
|
"GoWeb/controllers"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2022-11-04 20:12:57 +00:00
|
|
|
// PostRoutes defines all project post routes
|
2022-10-20 16:59:33 +00:00
|
|
|
func PostRoutes(app *app.App) {
|
2022-11-04 20:12:57 +00:00
|
|
|
// Post controller struct initialize
|
2022-10-20 16:59:33 +00:00
|
|
|
postController := controllers.PostController{
|
|
|
|
App: app,
|
|
|
|
}
|
|
|
|
|
2022-11-04 20:12:57 +00:00
|
|
|
// User authentication
|
2022-10-20 16:59:33 +00:00
|
|
|
http.HandleFunc("/register-handle", postController.Register)
|
|
|
|
http.HandleFunc("/login-handle", postController.Login)
|
|
|
|
}
|