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()
|
router := http.NewServeMux()
|
||||||
notesRouter := views.GetRoutes("/notes")
|
notesRouter := views.GetRoutes("/notes")
|
||||||
|
|
||||||
|
router.Handle("/", http.RedirectHandler("/notes/", http.StatusFound))
|
||||||
router.Handle("/notes/", http.StripPrefix("/notes", notesRouter))
|
router.Handle("/notes/", http.StripPrefix("/notes", notesRouter))
|
||||||
router.Handle(
|
router.Handle(
|
||||||
conf.Conf.Static.Root,
|
conf.Conf.Static.Root,
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ func GetRoutes(prefix string) *http.ServeMux {
|
||||||
myurls = urls.URLs{
|
myurls = urls.URLs{
|
||||||
Prefix: prefix,
|
Prefix: prefix,
|
||||||
URLs: map[string]urls.URL{
|
URLs: map[string]urls.URL{
|
||||||
|
"view_": {Path: "/{note}", Protocol: "GET", Handler: view},
|
||||||
"view": {Path: "/{note}/", Protocol: "GET", Handler: view},
|
"view": {Path: "/{note}/", Protocol: "GET", Handler: view},
|
||||||
"delete": {Path: "/{note}/delete/", Protocol: "GET", Handler: delete},
|
"delete": {Path: "/{note}/delete/", Protocol: "GET", Handler: delete},
|
||||||
"edit": {Path: "/{note}/edit/", Protocol: "GET", Handler: edit},
|
"edit": {Path: "/{note}/edit/", Protocol: "GET", Handler: edit},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue