source: iknow-api/Program.cs@ c0a75ab

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

First commit

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