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
Line 
1using Microsoft.EntityFrameworkCore;
2
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
11builder.Services.AddDbContext<AppDbContext>(options =>
12 options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
13
14var app = builder.Build();
15
16// Configure the HTTP request pipeline.
17if (app.Environment.IsDevelopment())
18{
19 app.MapOpenApi();
20}
21
22
23
24
25app.UseHttpsRedirection();
26
27app.UseAuthorization();
28
29app.MapControllers();
30
31app.Run();
Note: See TracBrowser for help on using the repository browser.