Table of Contents

API Configuration

This page covers the RecroGrid Framework API setup that is common to server applications regardless of whether the client reaches the API directly or through a host-side proxy.

Create the backend API application

Create an ASP.NET Core Web API application in Visual Studio or with the equivalent ASP.NET Core Web API template flow.

Register RecroGrid Framework services

Use the server package registration and application startup pipeline required by the RecroGrid Framework API runtime.

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddControllersWithViews();

builder.AddRGF();
builder.AddBaseDbContext();

var app = builder.Build();

app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();

app.UseAuthorization();

app.UseRGF<BaseDbContext, BaseDbContextPool, BaseDbContextPool>();

app.MapControllers();

app.Run();

What belongs here

This common API layer includes:

  • the RecroGrid Framework server package and API runtime;
  • AddRGF and AddBaseDbContext;
  • UseRGF;
  • the controller and application startup configuration needed by the server-side API.

Application-model-specific concerns such as CORS, direct browser bearer-token calls, or host-side proxy routing belong on the dedicated access pages instead of this page.

Next step