Files
Thuis_api/Program.cs
KaasKop- 1433d59207 Start on dockerization
Edited freezerDto a tad
2023-04-07 13:03:22 +02:00

38 lines
834 B
C#

using Microsoft.AspNetCore.Authentication;
using Microsoft.EntityFrameworkCore;
using ThuisApi.Data;
using ThuisApi.Models;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddDbContext<ThuisDbContext>(options =>
{
options.UseSqlite("Data Source=db.sqlite3");
});
builder.Services.AddAutoMapper(typeof(ThuisApiProfile));
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
// app.UseHttpsRedirection();
// app.UseAuthorization();
app.MapControllers();
app.Run();