Ignore:
Timestamp:
07/29/20 13:21:48 (2 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
de18858
Parents:
ef1219a
Message:

Add more services

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/Startup.cs

    ref1219a re42f61a  
    1111using FarmatikoData.FarmatikoRepoInterfaces;
    1212using FarmatikoData.FarmatikoRepo;
     13using FarmatikoServices.FarmatikoServiceInterfaces;
     14using FarmatikoServices.Services;
    1315
    1416namespace Farmatiko
     
    1618    public class Startup
    1719    {
     20        readonly string MyAllowSpecificOrigins = "_myAllowSpecificOrigins";
     21
    1822        public Startup(IConfiguration configuration)
    1923        {
     
    2630        public void ConfigureServices(IServiceCollection services)
    2731        {
     32            services.AddCors(options =>
     33            {
     34                options.AddPolicy(name: MyAllowSpecificOrigins,
     35                                  builder =>
     36                                  {
     37                                      builder.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin();
     38                                  });
     39            });
     40
    2841            services.AddControllersWithViews();
    2942            // In production, the Angular files will be served from this directory
     
    3750            services.AddTransient<IHealthFacilityRepository, HealthFacilityRepository>();
    3851            services.AddTransient<IHealthFacilityService, HealthFacilityService>();
     52            services.AddTransient<IHealthcareWorkerRepository, HealthcareWorkerRepository>();
     53            services.AddTransient<IHealthcareWorkerService, HealthcareWorkerService>();
    3954        }
    4055
     
    6277            app.UseRouting();
    6378
     79            app.UseCors(MyAllowSpecificOrigins);
     80
    6481            app.UseEndpoints(endpoints =>
    6582            {
Note: See TracChangeset for help on using the changeset viewer.