Uso de api para leer y ejecutar sentencias SQL
This commit is contained in:
38
ApiDatosGuadex/Program.cs
Normal file
38
ApiDatosGuadex/Program.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using ApiDatosGuadex.Filtros;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Agregar servicios al contenedor
|
||||
builder.Services.AddControllersWithViews();
|
||||
|
||||
// Registrar el filtro de autenticaci<63>n como servicio
|
||||
builder.Services.AddScoped<FiltroAutenticacionBasica>();
|
||||
|
||||
// Agregar Swagger
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
// Configuraci<63>n del pipeline de solicitudes HTTP
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
||||
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
app.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
|
||||
|
||||
app.Run();
|
||||
Reference in New Issue
Block a user