feat: support direct annotation links
This commit is contained in:
@ -16,13 +16,15 @@ func New(logger *logrus.Logger) *mux.Router {
|
||||
r.Use(mustHeaders)
|
||||
|
||||
r.Handle("/", templ.Handler(views.HomePage()))
|
||||
r.HandleFunc("/{id}-lyrics", lyrics(logger)).Methods("GET")
|
||||
r.HandleFunc("/albums/{artist}/{albumName}", album(logger)).Methods("GET")
|
||||
r.HandleFunc("/images/{filename}.{ext}", imageProxy(logger)).Methods("GET")
|
||||
r.HandleFunc("/search", search(logger)).Methods("GET")
|
||||
r.HandleFunc("/{id}/{artist-song}/{verse}/annotations", annotations(logger)).Methods("GET")
|
||||
r.HandleFunc("/{annotation-id}/{artist-song}/{verse}/annotations", annotations(logger)).Methods("GET")
|
||||
r.HandleFunc("/instances.json", instances(logger)).Methods("GET")
|
||||
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))
|
||||
r.PathPrefix("/{annotation-id}/{artist-song}-lyrics").HandlerFunc(lyrics(logger)).Methods("GET")
|
||||
r.PathPrefix("/{annotation-id}/{artist-song}").HandlerFunc(lyrics(logger)).Methods("GET")
|
||||
r.PathPrefix("/{annotation-id}").HandlerFunc(lyrics(logger)).Methods("GET")
|
||||
r.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
views.ErrorPage(404, "page not found").Render(context.Background(), w)
|
||||
|
Reference in New Issue
Block a user