Skip to content

Commit 6d05bdc

Browse files
authored
Merge pull request #53 from sergook/patch-1
CORS support
2 parents 53512d8 + ac2eff5 commit 6d05bdc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Advanced/TemplaterServer/src/Startup.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,23 @@ public Startup(IConfiguration configuration)
1616

1717
public void ConfigureServices(IServiceCollection services)
1818
{
19+
services.AddCors(options =>
20+
{
21+
options.AddDefaultPolicy(
22+
policy =>
23+
{
24+
policy
25+
.WithOrigins("http://localhost:3000", "http://localhost:3001")
26+
.AllowAnyHeader()
27+
.AllowAnyMethod();
28+
});
29+
});
1930
services.AddMvc(options => options.EnableEndpointRouting = false);
2031
}
2132

2233
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
2334
{
35+
app.UseCors();
2436
app.UseMvc();
2537
}
2638
}

0 commit comments

Comments
 (0)