NET-Web-API-w-Angular/Program.cs

29 lines
646 B
C#
Raw Normal View History

2024-02-09 00:29:56 +00:00
using Microsoft.EntityFrameworkCore;
2024-06-03 19:44:25 +00:00
using Api.Models;
2024-02-09 00:29:56 +00:00
var builder = WebApplication.CreateBuilder(new WebApplicationOptions {
Args = args,
WebRootPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "dist", "wwwroot", "browser")
});
2024-02-09 00:29:56 +00:00
builder.Services.AddControllers();
2024-06-03 19:44:25 +00:00
builder.Services.AddDbContext<Context>(opt =>
opt.UseInMemoryDatabase("List"));
2024-02-09 00:29:56 +00:00
var app = builder.Build();
if (builder.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();