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.
|
// This method gets called by the runtime. Use this method to add services to the container.
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
|
services.AddCors(o => o.AddPolicy("AllowAll", builder =>
|
||||||
|
{
|
||||||
|
builder.AllowAnyOrigin()
|
||||||
|
.AllowAnyMethod()
|
||||||
|
.AllowAnyHeader();
|
||||||
|
}));
|
||||||
services.AddScoped(serviceProvider => new TaskContext(
|
services.AddScoped(serviceProvider => new TaskContext(
|
||||||
new DbContextOptionsBuilder<TaskContext>()
|
new DbContextOptionsBuilder<TaskContext>()
|
||||||
.UseNpgsql("Host=nig.gl; Port=8543; Username=scrum; Database=taskboard; Password=c6gXud7YvBWp2sgxSgy4wRN")
|
.UseNpgsql("Host=nig.gl; Port=8543; Username=scrum; Database=taskboard; Password=c6gXud7YvBWp2sgxSgy4wRN")
|
||||||
@ -47,7 +53,8 @@ namespace ScrumTaskboard
|
|||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
//app.UseHttpsRedirection();
|
||||||
|
app.UseCors("AllowAll");
|
||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user