Compare commits

...

2 commits

2 changed files with 2 additions and 0 deletions

View file

@ -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,

View file

@ -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},