-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
@@ -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')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a semicolon here.
There was a problem hiding this comment.
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}`; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
No description provided.