-
Notifications
You must be signed in to change notification settings - Fork 429
Description
I'm rather new to Angular and trying to use this template to start a project, remove everything I don't need, configure what I need.
I found out that if to make additional setup for asp.net core project to use only https, SSR still works for rendering menus, buttons, but it doesn't perform api calls for content on server prerendering stage anymore, it happens in browser instead. As a result, if I disable javascript in browser and go to Rest API Demo, I still see the page looking quite normally, but with Loading... instead of list of users.
Is there some kind of catch? Am I missing something? Not being able to make api calls on server prerendering pretty much destroys SEO and the whole point of SSR.
To reproduce this, it's enough to open Startup.cs and add the following to the ConfigureServices() method:
services.AddHttpsRedirection(options =>
{
options.RedirectStatusCode = StatusCodes.Status301MovedPermanently;
});
services.AddMvc((Microsoft.AspNetCore.Mvc.MvcOptions x) =>
{
x.Filters.Add(new Microsoft.AspNetCore.Mvc.RequireHttpsAttribute());
});
Then add this to Configure() method:
app.UseHttpsRedirection();
Then just update Properties\launchSettings,json to use https, for example: https://localhost:44345/