Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Fix prefix static source 404 issue #4051

Merged
merged 5 commits into from
Aug 10, 2021

Conversation

acured
Copy link
Contributor

@acured acured commented Aug 10, 2021

No description provided.

@acured acured requested a review from Lijiaoa August 10, 2021 07:10
@@ -38,7 +38,7 @@ export class NNIRestServer extends RestServer {
* NNIRestServer's own router registration
*/
protected registerRestHandler(): void {
this.app.use(express.static('static'));
this.app.use(getPrefixUrl(), express.static('static'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a semicolon here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@@ -126,3 +126,8 @@ export function getDispatcherPipe(): string | null {
export function getAPIRootUrl(): string {
return getExperimentStartupInfo().apiRootUrl;
}

export function getPrefixUrl(): string {
const prefix = getExperimentStartupInfo().urlprefix === ''?'':`/${getExperimentStartupInfo().urlprefix}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add spaces around operators to make the style in sync with other codes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not add lint for this format in next release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@QuanluZhang QuanluZhang requested a review from ultmaster August 10, 2021 07:46
@QuanluZhang QuanluZhang merged commit 0fe0fd8 into microsoft:master Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants