Closed Bug 1168770 Opened 10 years ago Closed 10 years ago

web-server.js should serve index.html by default when accessing a directory

Categories

(Tree Management :: Treeherder, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

Details

Attachments

(1 file)

This would solve the remaining issues in bug 1060313: * broken link back from the log viewer to the main view * broken link from perfherder to the main view
It turns out web-server.js actually came from here: https://github.com/angular/angular-phonecat/commits/master/scripts/web-server.js ...rather than the previous place we thought it came from. They've since deleted the file, so I don't see any harm in us modifying our own copy as we see fit. I've looked into alternatives available on npm and they all have third party dependencies, so aren't as convenient for just checking into the repo.
Assignee: nobody → emorley
Attachment #8611164 - Flags: review?(mdoglio)
Summary: web-server.js should redirect '/' to '/index.html' → web-server.js should serve index.html by default when accessing a directory
Attachment #8611164 - Flags: review?(mdoglio) → review+
Commits pushed to master at https://github.com/mozilla/treeherder https://github.com/mozilla/treeherder/commit/eb6fe42ba2b757d7135a6fadccd0da35c24b4184 Bug 1168770 - web-server.js: Move directory handling to its own function Since we're about to add index.html support on top. https://github.com/mozilla/treeherder/commit/ae98e9d85943b579fdeb0f338388874fe22507c9 Bug 1168770 - web-server.js: Serve index.html by default, if present Instead of always displaying the directory file listing, if index.html is present we serve that instead. This not only fixes the remaining broken URLs when using web-server.js, but also means people can click the "Starting web server at <URL>" link in the console and immediately see Treeherder, without having to then manually navigate to index.html themselves.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Component: Treeherder: Docs & Development → TreeHerder
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: