forked from rohanthewiz/go_notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.go
29 lines (27 loc) · 951 Bytes
/
routes.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
package main
import (
"github.com/julienschmidt/httprouter"
)
func doRoutes(router * httprouter.Router) {
router.GET("/", Index)
router.GET("/ql", QueryLast)
router.GET("/qi/:id", QueryId)
router.GET("/json/qi/:id", QueryIdAsJson)
router.GET("/qg/:tag", QueryTag)
router.GET("/g/:tag", QueryTag)
router.GET("/qt/:title", QueryTitle)
router.GET("/q/:query", Query)
router.GET("/q/:query/l/:limit", Query)
router.GET("/qg/:tag/q/:query", QueryTagAndWildCard)
router.GET("/q/:query/qg/:tag", QueryTagAndWildCard)
router.GET("/g/:tag/:query", QueryTagAndWildCard)
router.GET("/qt/:title/q/:query", QueryTitleAndWildCard)
router.GET("/q/:query/qt/:title", QueryTitleAndWildCard)
router.GET("/show/:id", QueryId)
router.GET("/new", WebNoteForm)
router.GET("/edit/:id", WebNoteForm)
router.GET("/del/:id", WebDeleteNote)
router.GET("/js/:file", ServeJS)
router.POST("/create", WebCreateNote)
router.POST("/note/:id", WebUpdateNote)
}