Changeset e42f61a for Farmatiko/Startup.cs
- Timestamp:
- 07/29/20 13:21:48 (5 years ago)
- Branches:
- master
- Children:
- de18858
- Parents:
- ef1219a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/Startup.cs
ref1219a re42f61a 11 11 using FarmatikoData.FarmatikoRepoInterfaces; 12 12 using FarmatikoData.FarmatikoRepo; 13 using FarmatikoServices.FarmatikoServiceInterfaces; 14 using FarmatikoServices.Services; 13 15 14 16 namespace Farmatiko … … 16 18 public class Startup 17 19 { 20 readonly string MyAllowSpecificOrigins = "_myAllowSpecificOrigins"; 21 18 22 public Startup(IConfiguration configuration) 19 23 { … … 26 30 public void ConfigureServices(IServiceCollection services) 27 31 { 32 services.AddCors(options => 33 { 34 options.AddPolicy(name: MyAllowSpecificOrigins, 35 builder => 36 { 37 builder.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin(); 38 }); 39 }); 40 28 41 services.AddControllersWithViews(); 29 42 // In production, the Angular files will be served from this directory … … 37 50 services.AddTransient<IHealthFacilityRepository, HealthFacilityRepository>(); 38 51 services.AddTransient<IHealthFacilityService, HealthFacilityService>(); 52 services.AddTransient<IHealthcareWorkerRepository, HealthcareWorkerRepository>(); 53 services.AddTransient<IHealthcareWorkerService, HealthcareWorkerService>(); 39 54 } 40 55 … … 62 77 app.UseRouting(); 63 78 79 app.UseCors(MyAllowSpecificOrigins); 80 64 81 app.UseEndpoints(endpoints => 65 82 {
Note:
See TracChangeset
for help on using the changeset viewer.