Software Alternatives, Accelerators & Startups

Enable CORS in ASP.NET Core in the Easiest Way

Domain.com
  1. 1
    E

    Example.com

    This product hasn't been added to SaaSHub yet
    /* In Startup.cs configure services method, we add a CORS policy */ Public void ConfigureServices(IServiceCollection services) { services.AddCors(options => { options.AddPolicy("AllowSpecificOrigin", builder => { builder.WithOrigins("http://example.com", "http://example2.com") .AllowAnyHeader() .AllowAnyMethod(); }); }); }.

  2. Find and purchase your next website domain name and hosting without breaking the bank. Seamlessly establish your online identify today.
    // .NET Core Allow CORS methods at a glance: App.UseCors(builder => builder.AllowAnyOrigin()); // Allow requests from any origin App.UseCors(builder => builder.WithOrigins("http://domain.com")); // Allow requests only from domain.com App.UseCors(builder => builder.AllowAnyHeader()); // Allow any header in the request App.UseCors(builder => builder.AllowAnyMethod()); // Allow any HTTP method in the request.

    #Web Hosting #Domains #Domain Names 771 social mentions

Discuss: Enable CORS in ASP.NET Core in the Easiest Way

Log in or Post with