Nexus HTTP API

A REST API for all Nexus features are included, and it's what the admin UI uses. The API is not enabled by default but all you need to do to enable it is:

builder.Services.AddNexusApi(options =>
{
    // The default options are:
    options.BasePath = "/";
    options.EnvironmentName = null;
    options.RegisterHealthChecksAsAspNetCoreHealthChecks = true;
    options.AdminUI.Path = "admin";
    options.AdminUI.InfoNotice = null;
    options.AllowAnonymousApiAccess = true;
});

When BasePath is / it means that the API is accessible on https://servername/api and if you set it to /mybasepath/ the API is accessible on https://servername/mybasepath/api.

When BasePath is / it also means that the admin UI is accessible on https://servername/admin and if you set the base path it to /mybasepath/ the admin UI is on https://servername/mybasepath/admin.

Authentication

One of the options above is if the system should allow anonymous API access or not. If you configure not to allow it the system does not do any authorization though and leaves it up to you to authorize the user through eg a cookie. The system will check if HttpContext.User.Identity.IsAuthenticated and otherwise respond with HTTP status 401 on any API requests.

If you wish to add login to the Admin UI you should setup a middleware on the admin route which checks if the user is signed in or not and redirect to/display a login page. Something like this:

// Program.cs
builder.Services.AddNexusApi(options =>
{
    options.AllowAnonymousApiAccess = false;
});

var app = builder.Build();
app.Use(async (context, next) =>
{
    if (context.Request.Path.Value?.StartsWith("/admin") == true && context.User.Identity?.IsAuthenticated == false)
    {
        context.Response.Redirect("/login");
        await context.Response.CompleteAsync();
    }
    else
    {
        await next();
    }
});
app.UseNexusAdminUI();

If you then implement the /login route to show a login form that redirects back to /admin when the user has logged in your Nexus admin UI and API is fully protected.

Endpoints

You can see a full list of the API endpoints for jobs and queues in the Swagger UI.

There's a demo environment that's deployed to a free tier Azure Web App here:
https://commerce-mind-nexus.azurewebsites.net/swagger/index.html

You can send requests to any endpoint you'd like to get a feel for what the system does. Since it's a free tier Azure Web App the scheduler is paused when nobody is using the API or admin UI which means that the jobs won't run exactly according to schedule.