source: iknow-api/Program.cs@ 5aa102d

Last change on this file since 5aa102d was 5aa102d, checked in by stefansaveski <stefansaveski19@…>, 11 months ago

First commit

  • Property mode set to 100644
File size: 634 bytes
RevLine 
[2859225]1using Microsoft.EntityFrameworkCore;
2
[0b16523]3var builder = WebApplication.CreateBuilder(args);
4
5// Add services to the container.
6
7builder.Services.AddControllers();
8// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
9builder.Services.AddOpenApi();
10
[5aa102d]11builder.Services.AddDbContext<AppDbContext>(options =>
12 options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
13
[0b16523]14var app = builder.Build();
15
16// Configure the HTTP request pipeline.
17if (app.Environment.IsDevelopment())
18{
19 app.MapOpenApi();
20}
21
[5aa102d]22
[2859225]23
24
[0b16523]25app.UseHttpsRedirection();
26
27app.UseAuthorization();
28
29app.MapControllers();
30
31app.Run();
Note: See TracBrowser for help on using the repository browser.