-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
27 lines (24 loc) · 830 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
package main
import (
"net/http"
"quiltspace/quilts"
"quiltspace/user"
"github.com/julienschmidt/httprouter"
)
func main() {
// handling routing with third-party router from httprouter
router := httprouter.New()
router.GET("/", quilts.Home)
router.GET("/quilts", quilts.Index)
router.GET("/about", quilts.About)
router.GET("/quilts/show", quilts.Show)
router.GET("/quilts/create", quilts.CreateForm)
router.POST("/quilts/create/process", quilts.CreateProcess)
router.GET("/quilts/update", quilts.UpdateForm)
router.POST("/quilts/update/process", quilts.UpdateProcess)
router.GET("/quilts/delete/process", quilts.DeleteProcess)
router.GET("/user/create", user.SignUpForm)
router.POST("/user/create/process", user.SignUpProcess)
router.GET("/user/login", user.LoginForm)
http.ListenAndServe(":8080", router)
}