Added Cors related Allow All Origins service config
This commit is contained in:
parent
e72eb96ee7
commit
aed9ca008a
|
@ -26,6 +26,12 @@ namespace ScrumTaskboard
|
|||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddCors(o => o.AddPolicy("AllowAll", builder =>
|
||||
{
|
||||
builder.AllowAnyOrigin()
|
||||
.AllowAnyMethod()
|
||||
.AllowAnyHeader();
|
||||
}));
|
||||
services.AddScoped(serviceProvider => new TaskContext(
|
||||
new DbContextOptionsBuilder<TaskContext>()
|
||||
.UseNpgsql("Host=nig.gl; Port=8543; Username=scrum; Database=taskboard; Password=c6gXud7YvBWp2sgxSgy4wRN")
|
||||
|
@ -47,7 +53,8 @@ namespace ScrumTaskboard
|
|||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
//app.UseHttpsRedirection();
|
||||
app.UseCors("AllowAll");
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
|
|
Loading…
Reference in New Issue