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

RESOLVED FIXED

Status

P3
normal
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
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
(Assignee)

Comment 1

3 years ago
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)

Comment 2

3 years ago
Created attachment 8611164 [details] [review]
Serve index.html by default, if present
Assignee: nobody → emorley
Attachment #8611164 - Flags: review?(mdoglio)
(Assignee)

Updated

3 years ago
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+

Comment 3

3 years ago
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.
(Assignee)

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.