53 lines
942 B
C#
53 lines
942 B
C#
using Emberend.Endpoints;
|
|
using System.Net;
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.AddSwaggerGen();
|
|
|
|
|
|
builder.WebHost.ConfigureKestrel(options =>
|
|
{
|
|
options.AddServerHeader = false;
|
|
|
|
options.Listen(IPAddress.Any, 8085);
|
|
//options.Listen(IPAddress.Any, 4431, listenOptions =>
|
|
//{
|
|
// listenOptions.UseHttps("/etc/letsencrypt/live/x/letsencrypt.pfx", "");
|
|
//});
|
|
});
|
|
|
|
|
|
|
|
var app = builder.Build();
|
|
|
|
if (app.Environment.IsDevelopment())
|
|
{
|
|
app.UseSwagger();
|
|
app.UseSwaggerUI();
|
|
}
|
|
|
|
|
|
app.MapUserAccessEndpoints();
|
|
|
|
//Ne treba jer koristimo nginx kao relay/proxy...
|
|
//app.UseHttpsRedirection();
|
|
|
|
|
|
app.MapGet("/", async (HttpContext context) =>
|
|
{
|
|
await context.Response.WriteAsync("Hello, alex-api.onlystefan.com");
|
|
});
|
|
|
|
app.MapGet("/test", async (HttpContext context) =>
|
|
{
|
|
await context.Response.WriteAsync("test");
|
|
});
|
|
|
|
|
|
app.Run();
|
|
|
|
|
|
|