-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
46 lines (33 loc) · 951 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"github.com/gorilla/sessions"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4"
)
func main() {
db = ConnectDB()
defer db.Close()
e := echo.New()
e.Use(session.Middleware(sessions.NewCookieStore([]byte("secret"))))
e.Renderer = Templs("templates")
// files
e.Static("/assets", Assets())
e.Static("/fs", PhotoFold())
// account and verefy
e.GET("/", HomePage)
e.GET("/sign", SignPage)
e.POST("/sign", Signup)
e.GET("/login", LoginPage)
e.POST("/login", Login)
e.GET("/user/:id", Profile)
e.GET("/fotos", PhotosPage)
e.POST("/upfotos/:id", UpPhotos)
e.GET("/upacount", UpdatePage)
e.POST("/upacount", Update)
e.GET("/messages", MessagesPage)
e.GET("/activity", ActivityPage)
e.GET("/search", SearchPage)
//e.POST("/updatefotos/:id", updateProdFotos)
//e.GET("/:catigory/:id", getOneProd) // whech is beter ? :catigory or /product ?
e.Logger.Fatal(e.Start(":8080"))
}