Merge branch 'master' into feature/tasks-controller

This commit is contained in:
Niggl1999 2020-06-03 20:06:55 +02:00
commit c3833b1b04
2 changed files with 9 additions and 2 deletions

View File

@ -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();

View File

@ -21,7 +21,7 @@ services:
networks: networks:
- default - default
ports: ports:
- "8080:80" - "5001:80"
volumes: volumes:
db-data: db-data: