Goa.Functions.ApiGateway 0.0.2-preview.2.2

This is a prerelease version of Goa.Functions.ApiGateway.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Goa.Functions.ApiGateway --version 0.0.2-preview.2.2
                    
NuGet\Install-Package Goa.Functions.ApiGateway -Version 0.0.2-preview.2.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Goa.Functions.ApiGateway" Version="0.0.2-preview.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Goa.Functions.ApiGateway" Version="0.0.2-preview.2.2" />
                    
Directory.Packages.props
<PackageReference Include="Goa.Functions.ApiGateway" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Goa.Functions.ApiGateway --version 0.0.2-preview.2.2
                    
#r "nuget: Goa.Functions.ApiGateway, 0.0.2-preview.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Goa.Functions.ApiGateway@0.0.2-preview.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Goa.Functions.ApiGateway&version=0.0.2-preview.2.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Goa.Functions.ApiGateway&version=0.0.2-preview.2.2&prerelease
                    
Install as a Cake Tool

Goa.Functions.ApiGateway

API Gateway integration with V1/V2 payload support for high-performance AWS Lambda functions. This package provides seamless integration with AWS API Gateway using ASP.NET Core patterns.

Installation

dotnet add package Goa.Functions.ApiGateway

Features

  • Native AOT support for faster Lambda cold starts
  • Support for both API Gateway V1 and V2 payload formats
  • ASP.NET Core integration with familiar patterns
  • Built-in JWT token validation
  • Automatic request/response transformation
  • Middleware support for cross-cutting concerns

Usage

Basic Setup

using Goa.Functions.ApiGateway;

var builder = WebApplication.CreateBuilder(args);
builder.UseGoa();

var app = builder.Build();

app.MapGet("/users/{id}", (string id) => 
{
    return Results.Ok(new { Id = id, Name = "John Doe" });
});

app.Run();

Program.cs (Minimal API)

using Goa.Functions.ApiGateway;

var builder = WebApplication.CreateBuilder(args);
builder.UseGoa(ApiGatewayType.HttpV2);

var app = builder.Build();

// Configure your endpoints
app.MapGet("/health", () => Results.Ok(new { Status = "Healthy" }));

app.MapPost("/users", (CreateUserRequest request) => 
{
    // Create user logic
    return Results.Created($"/users/{request.Id}", request);
});

app.MapGet("/users/{id}", (string id) => 
{
    // Get user logic
    return Results.Ok(new { Id = id, Name = "User Name" });
});

// Start the Lambda runtime
app.Run();

With Controllers

using Microsoft.AspNetCore.Mvc;

[ApiController]
[Route("api/[controller]")]
public class UsersController : ControllerBase
{
    [HttpGet("{id}")]
    public ActionResult<User> GetUser(string id)
    {
        // Your logic here
        return Ok(new User { Id = id, Name = "John Doe" });
    }
    
    [HttpPost]
    public ActionResult<User> CreateUser([FromBody] CreateUserRequest request)
    {
        // Your logic here
        return CreatedAtAction(nameof(GetUser), new { id = request.Id }, request);
    }
}

JWT Authentication

using Microsoft.AspNetCore.Authentication.JwtBearer;

var builder = WebApplication.CreateBuilder(args);
builder.UseGoa();

// Add JWT authentication
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
    .AddJwtBearer(options =>
    {
        options.Authority = "https://your-auth-provider.com";
        options.Audience = "your-api-audience";
    });
builder.Services.AddAuthorization();

var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();

app.MapGet("/protected", () => "Protected content")
    .RequireAuthorization();

app.Run();

Documentation

For more information and examples, visit the main Goa documentation.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.3-preview.1 48 8/23/2025
0.0.2-preview.2.3 119 8/18/2025
0.0.2-preview.2.2 128 8/17/2025
0.0.2-preview.2.1 87 8/17/2025
0.0.2-preview.2 201 8/9/2025
0.0.0-alpha.0.32 140 12/7/2024
0.0.0-alpha.0.29 94 12/4/2024
0.0.0-alpha.0.20 99 10/27/2024