πŸ‘¨β€πŸ’» niltor    πŸ“† 2026-10-08 10:56

MiniApi Quick Start

MiniApi targets lightweight APIs and microservices. It uses Minimal API, PostgreSQL, the Request Delegate Generator, and NativeAOT. It does not include a built-in EF Core migration resource, AdminService, or a default Angular frontend.

MiniApi uses Aspire 13.5.0; install a matching Aspire CLI before running AppHost.

Create a project

dotnet new install Perigon.templates --version 1.3.17
dotnet new perigon-miniapi -n MyMiniApi --frontType None
cd MyMiniApi

Use --frontType Angular when needed and run pnpm install; the frontend still must be enabled in AppHost explicitly.

Configure and run

MiniApi uses PostgreSQL only. Configure the cache in src/AppHost/appsettings.Development.json:

{
  "Components": {
    "Cache": "Memory"
  }
}

AppHost creates Redis only for Redis or Hybrid and passes the choice to ApiService through Components__Cache. The default is memory cache, so Redis is not required for the first run.

aspire start --non-interactive

MiniApi does not use the EF migration script. When adding entities, follow the DefaultDbContext conventions and the PostgreSQL data-access approach already present in the project.

OpenAPI, AOT, and tests

The default OpenAPI JSON document is available at:

/openapi/v1.json

ApiService is configured for NativeAOT and can be published directly:

dotnet publish src/Services/ApiService/ApiService.csproj -c Release

Unit tests do not start Aspire:

dotnet test --project tests/UnitTest/UnitTest.csproj

Run integration tests when validating AppHost, PostgreSQL, or service contracts:

dotnet test --project tests/ApiTest/ApiTest.csproj --treenode-filter '/*/*/*/*[Category=Integration]'

See the Production Operations Runbook for publishing and container health checks.