Compare commits
2 commits
8f60040f86
...
551dcf5905
| Author | SHA1 | Date | |
|---|---|---|---|
| 551dcf5905 | |||
| c82db192e1 |
2 changed files with 2 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ func main() {
|
|||
router := http.NewServeMux()
|
||||
notesRouter := views.GetRoutes("/notes")
|
||||
|
||||
router.Handle("/", http.RedirectHandler("/notes/", http.StatusFound))
|
||||
router.Handle("/notes/", http.StripPrefix("/notes", notesRouter))
|
||||
router.Handle(
|
||||
conf.Conf.Static.Root,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ func GetRoutes(prefix string) *http.ServeMux {
|
|||
myurls = urls.URLs{
|
||||
Prefix: prefix,
|
||||
URLs: map[string]urls.URL{
|
||||
"view_": {Path: "/{note}", Protocol: "GET", Handler: view},
|
||||
"view": {Path: "/{note}/", Protocol: "GET", Handler: view},
|
||||
"delete": {Path: "/{note}/delete/", Protocol: "GET", Handler: delete},
|
||||
"edit": {Path: "/{note}/edit/", Protocol: "GET", Handler: edit},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue