Skip to content

Commit

Permalink
feat(bazel): check all known index html file names for the index file (
Browse files Browse the repository at this point in the history
…#2255)

Check for `index.csr.html`, `index.html` or `index.server.html` to serve the default index html file.

PR Close #2255
  • Loading branch information
josephperrott committed Aug 16, 2024
1 parent d0dde31 commit 67489d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bazel/http-server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ export class HttpServer {
/** Gets the raw content of the index.html. */
private _getIndexHtmlContent(): string {
if (!this._index) {
const indexPath = this._resolveUrlFromRunfiles('/index.html');
// Check all of the known index file names.
const indexPath =
this._resolveUrlFromRunfiles('/index.html') ||
this._resolveUrlFromRunfiles('/index.csr.html') ||
this._resolveUrlFromRunfiles('/index.server.html');

if (!indexPath) {
throw Error('Could not resolve http server index.html');
Expand Down

0 comments on commit 67489d1

Please sign in to comment.