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