This repository was archived by the owner on May 1, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ public static IWebHost BuildWebHost(string[] args) =>
6161 WebHost . CreateDefaultBuilder ( args )
6262 . UseStartup < Startup > ( )
6363#if ! DEBUG
64- . UseUrls ( "http://0.0.0.0:80 " )
64+ . UseUrls ( "http://0.0.0.0:5001 " )
6565#endif
6666 . Build ( ) ;
6767 }
Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ public Startup(IConfiguration configuration)
4747 /// </param>
4848 public void ConfigureServices ( IServiceCollection services )
4949 {
50+ services . AddCors ( o => o . AddPolicy ( "MyPolicy" , builder =>
51+ {
52+ builder . AllowAnyOrigin ( )
53+ . AllowAnyMethod ( )
54+ . AllowAnyHeader ( ) ;
55+ } ) ) ;
5056 var connection = Configuration . GetConnectionString ( "DefaultConnection" ) ;
5157 services . AddDbContext < Models . ApiContext > ( options => options . UseSqlServer ( connection ) ) ;
5258 services . AddMvc ( ) ;
@@ -64,6 +70,7 @@ public void ConfigureServices(IServiceCollection services)
6470 // ReSharper disable once UnusedMember.Global
6571 public void Configure ( IApplicationBuilder app , IHostingEnvironment env )
6672 {
73+ app . UseCors ( "MyPolicy" ) ;
6774 app . Use ( async ( context , next ) => {
6875 await next ( ) ;
6976
You can’t perform that action at this time.
0 commit comments