Skip to content

Make baseHref/publicURL automatic and supportive of CSPInstanceName #17

@isc-tleavitt

Description

@isc-tleavitt

Rather than doing tricky web application replacements at package activation time, it would be better if the static file handlers supported setting the base URL (for both Angular and React) at runtime based on %request.Application which will possibly include the CSPInstanceName.

e.g., if I have a web application /personal, and it's served via CSPInstanceName iris20241, %request.Application will have /iris20241/personal/. This should automatically be set as the base URL in staticFilesHandler.

Taking this approach will support cases where the same instance is accessed both with and without a CSPInstanceName and avoid needing a fraught and super-ugly publicURL expression, like:

<Resource Name="/react/copilot-mockup" ProcessorClass="pkg.isc.ipm.js.react.processor" publicURL="#{$Select($Data(^%SYS(&quot;WebServer&quot;,&quot;URLPrefix&quot;),prefix)#2&amp;&amp;(prefix'=&quot;&quot;):&quot;/&quot;_prefix,1:&quot;&quot;)}/personal" />

An error in which ended up leading to #16 .

For the sake of performance we'll probably want to cache file contents with URL replacements performed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions