Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • iknow-api/Program.cs

    r277bd72 r0b16523  
    1 using Microsoft.EntityFrameworkCore;
    2 using iknow_api.Core.Data;
    3 using iknow_api.Services;
    4 using iknow_api.Repositories;
    5 
    61var builder = WebApplication.CreateBuilder(args);
    72
    83// Add services to the container.
     4
    95builder.Services.AddControllers();
     6// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
    107builder.Services.AddOpenApi();
    11 
    12 // Register DbContext
    13 builder.Services.AddDbContext<AppDbContext>(options =>
    14     options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
    15 
    16 // Register your services
    17 builder.Services.AddScoped<IAuthService, AuthService>();
    18 builder.Services.AddScoped<IUserRepository, UserRepository>(); // You'll need to add the UserRepository implementation
    198
    209var app = builder.Build();
    … …  
    2716
    2817app.UseHttpsRedirection();
     18
    2919app.UseAuthorization();
     20
    3021app.MapControllers();
    3122
Note: See TracChangeset for help on using the changeset viewer.