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

All links point to the backend server URL #13

Open
MineshS opened this issue Aug 6, 2021 · 6 comments
Open

All links point to the backend server URL #13

MineshS opened this issue Aug 6, 2021 · 6 comments

Comments

@MineshS
Copy link

MineshS commented Aug 6, 2021

When navigating around the front end site all links are pointing to the backend server URL i.e.

image

@JohanPetersson
Copy link
Contributor

Thanks for reporting. There is an initialization issue in the sample site. During first run, the website is created but then URLs have already been cached. Same thing for images. If you just restart the website, then the links will point correct, but images will stop working.

@bb-ceccles
Copy link

Is there a way to have the images working as having the site setup as http://localhost:8080/ sets the links to work correctly but as noted above the images are then linking to http://localhost:8080/ not http://localhost:8081/.

Is there something in the JSON serialization pipeline that can override this for image assets.

Looking at the old Content API documentation there is the concept of IPropertyModelConverter but I cant see this in the new .Net Core version of the packages.

@JohanPetersson
Copy link
Contributor

JohanPetersson commented Sep 1, 2021

First, the bug in the sample site regarding caching of the URLs should be fixed soon.

The idea is that assets should be served from the backend/management application. So if you host the frontend on port 8080 and the backend on 8081, then the assets should be served from 8081 and the links on 8080 should point to these. This bug has nothing to do with this repository though. Not sure what the root cause of this issue is yet, it could be in CMS 12, the preview version of .NET Core. Content Delivery API subscribes to the events in EPiServer.Core.Routing.IContentUrlGeneratorEvents and then making sure correct host is used for the generated URL to IContentMedia types.
You don't want to use IPropertyModelConverter or similar approach, because then you need to parse out links in e.g. XHTML strings and rewrite them.

@JohanPetersson
Copy link
Contributor

We have an internal bug tracking this issue. I'll keep you posted here when we have released a fixed version.

@bb-ceccles
Copy link

Thanks for the update @JohanPetersson.

@JohanPetersson
Copy link
Contributor

@bb-ceccles master branch is now updated with a fixed version where asset links point to the correct host. We've removed all local packages and use the beta feed instead. So if you update all EPiServer.ContentDeliveryApi.* to version 3.0.0-ci-002437 this should work. The beta feed URL is available in the nuget.config files here.

There is still an issue with the initial request, where ALL links will point to the management application, but that's just a sample site setup-thing. We will fix that soon as well.

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

No branches or pull requests

3 participants