AI OnAI Off
Hi,
There's no middleware, but an endpoint routing matcher policy. You enable it with:
services
.AddContentDeliveryApi()
.WithFriendlyUrl();
Hey Johan, thanks!
I couldn't find the .WithFriendlyUrl()
extension but .AddContentApiRouting()
did the trick for me (found in namespace EPiServer.ContentApi.Routing
).
Best regards
/Anders
Ah, in the release version the method is .WithFriendlyUrl()
. So keep that in mind :)
Hi!
I'm having some trouble with the new Content Delivery API for CMS 12. At the moment I'm working with 3.0.0-ci-002490.
Everything works fine using the endpoints from /api/episerver/v3.0/ but the content delivery API does not kick in when using "friendly URLs" (e.g. /en) with the Accept: application/json header, which if course works fine in the CMS 11 + Content Delivery API 2.x.
I feel I must have missed something in the setup. Is there a middleware that needs to be plugged in? I currently have:
services.AddContentDeliveryApi(null, options =>
{
options.SetSiteDefinitionApiEnabled(true);
options.SetMinimumRoles(string.Empty);
});
in the ConfigureServices method, and nothing related to the content delivery API in Configure as far as I can see:
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapContent();
});
Has anyone gotten this to work and can provide some insight? Would be much appreciated :-)
Best regards
/Anders