Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 merged commit 0fe0fd8 into microsoft:master Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants