So I took this sample
kendo-angular/examples-standalone/aspnetcore-upload at master · telerik/kendo-angular (github.com)
Removed these lines
/{
// // To learn more about options for serving an Angular SPA from ASP.NET Core,
// // see https://go.microsoft.com/fwlink/?linkid=864501
// spa.Options.SourcePath = "ClientApp";
// if (env.IsDevelopment())
// {
// spa.UseAngularCliServer(npmScript: "start");
// }
//});
changed this line to..
Then loaded the ClientApp in VS code.. Ran it and got the cors error...
I tried to add these lines below but I still got the same error. What minimal changes do I need to do with this sample to split out the server and client ?
options.AddPolicy("CorsPolicy",
builder =>
{
builder.WithOrigins("http://localhost:4200")
.AllowAnyHeader();
});
});
app.UseCors("CorsPolicy");