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

CfW: Allow web resource routing configuration #3852

Merged
merged 5 commits into from Oct 24, 2023

Conversation

eymar
Copy link
Collaborator

@eymar eymar commented Oct 23, 2023

This commit changes the default resource routing behaviour:

  • It used to search for a file in the root directory (on a domain level)
  • After this change, it will search for a file relatively to the current url segment

Besides that, we add a small configuration to let developers change the default behaviour when needed.


usage examples:

// 1
configureWebResources {
   setResourceFactory { path -> urlResource("/myApp1/resources/$path") }
}

// 2
configureWebResources {
  setResourcelFactory { path -> urlResource("https://mycdn.com/myApp1/res/$path") }
}

This will fix #3413 (currently it bothers our users)

This commit changes the default resource routing behaviour:
- It used to search for a file in the root directory (on a domain level)
- After this change, it will search for a file relatively to the current url segment

Besides that, we add a small configuration to let developers change the default behaviour when needed.
@eymar
Copy link
Collaborator Author

eymar commented Oct 23, 2023

cc: @pjBooms Please have a look

@eymar eymar requested a review from pjBooms October 24, 2023 12:57
@eymar eymar merged commit 7380229 into master Oct 24, 2023
@eymar eymar deleted the allow_web_resources_routing_configuration branch October 24, 2023 13:54
eymar added a commit that referenced this pull request Oct 24, 2023
This commit changes the default resource routing behaviour:
- It used to search for a file in the root directory (on a domain level)
- After this change, it will search for a file relatively to the current
url segment

Besides that, we add a small configuration to let developers change the
default behaviour when needed.

___

usage examples:

```kotlin
// 1
configureWebResources {
   setResourceFactory { path -> urlResource("/myApp1/resources/$path") }
}

// 2
configureWebResources {
  setResourcelFactory { path -> urlResource("https://mycdn.com/myApp1/res/$path") }
}
 ```

___
This will fix #3413 (currently it bothers our users)

(cherry picked from commit 7380229)
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.

Wasm/JS Resources, relative path
3 participants