Rework
This commit is contained in:
41
API/Api.cs
Normal file
41
API/Api.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using SQLiteEF;
|
||||
|
||||
namespace API;
|
||||
|
||||
public class Api
|
||||
{
|
||||
public Api(string[] args)
|
||||
{
|
||||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
|
||||
builder.Services.AddOpenApi();
|
||||
|
||||
builder.Services.AddDbContext<Context>();
|
||||
|
||||
WebApplication app = builder.Build();
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.MapOpenApi();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.Run();
|
||||
}
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Api _ = new (args);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user