Skip to content

Commit

Permalink
serve all in-crate js files
Browse files Browse the repository at this point in the history
starting with rust-lang/rust#59776, the search index, aliases, and
source file list are getting the resource suffix added to their file
names. this means we can't route them from a static path any more.

since we always check the static file router first, this will still
allow serving `main.js` for rustdoc versions prior to the addition of
`--static-root-path`, and also allows rustdoc to add per-crate
javascript files without requiring docs.rs to update to handle it.

(it also allows us to start hosting things *other* than rustdoc output
as docs - e.g. mdbook output - in the future without changing the
routing table massively.)
  • Loading branch information
QuietMisdreavus committed Apr 29, 2019
1 parent 46fa554 commit a83da34
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/web/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,15 @@ impl CratesfyiHandler {
router.get("/:crate/:version/",
rustdoc::rustdoc_redirector_handler,
"crate_version_");
router.get("/:crate/:version/search-index.js",
rustdoc::rustdoc_html_server_handler,
"crate_version_search_index_js");
router.get("/:crate/:version/*.js",
rustdoc::rustdoc_redirector_handler,
"crate_version_js");
router.get("/:crate/:version/settings.html",
rustdoc::rustdoc_html_server_handler,
"crate_version_settings_html");
router.get("/:crate/:version/all.html",
rustdoc::rustdoc_html_server_handler,
"crate_version_all_html");
router.get("/:crate/:version/aliases.js",
rustdoc::rustdoc_html_server_handler,
"crate_version_aliases_js");
router.get("/:crate/:version/source-files.js",
rustdoc::rustdoc_html_server_handler,
"crate_version_source_files_js");
router.get("/:crate/:version/:target",
rustdoc::rustdoc_redirector_handler,
"crate_version_target");
Expand Down

0 comments on commit a83da34

Please sign in to comment.