1 Commits

Author SHA1 Message Date
danda
0c54b50b83 refactor: use wildcard paths, remove dup handlers
We use axum route wildcards to merge duplicate page routes and handlers
into a single route and handler.

This makes the routes simpler/cleaner as well as the handlers, as there
is now just one of each for each html page.

Previous:
   .route("/block/:selector", get(block_page))
   .route("/block/:selector/value", get(block_page_with_value))

New:
   .route("/block/*selector", get(block_page))

This is achieved by replacing PathBlockSelector with
BlockSelectorExtended which wraps BlockSelector to provide parsing for
height_or_digest/value.  (which is needed for javascript-free input
form)

Changes:
 * merge dup handlers for each of block, block_digest, block_info
 * merge routes for same
 * add BlockSelectorExtended and HeightOrDigest
 * remove PathBlockSelector
2024-05-22 17:18:51 -07:00