Goa.Functions.ApiGateway 0.0.3-preview.1

This is a prerelease version of Goa.Functions.ApiGateway.
dotnet add package Goa.Functions.ApiGateway --version 0.0.3-preview.1
                    
NuGet\Install-Package Goa.Functions.ApiGateway -Version 0.0.3-preview.1
                    
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.3-preview.1" />
                    
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.3-preview.1" />
                    
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.3-preview.1
                    
#r "nuget: Goa.Functions.ApiGateway, 0.0.3-preview.1"
                    
#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.3-preview.1
                    
#: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.3-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Goa.Functions.ApiGateway&version=0.0.3-preview.1&prerelease
                    
Install as a Cake Tool

Goa.Functions.ApiGateway

Build high-performance AWS Lambda functions with ASP.NET Core integration for API Gateway HTTP/REST APIs. This package provides seamless integration between AWS API Gateway and ASP.NET Core, supporting both V1 and V2 payload formats with native AOT compilation for optimal cold start performance.

Quick Start

dotnet new install Goa.Templates
dotnet new goa.apigw -n "MyApiFunction"

Features

  • ASP.NET Core Integration: Full support for ASP.NET Core middleware, routing, and endpoints
  • Multiple API Gateway Types: Support for HTTP API V2, HTTP API V1, and REST API formats
  • Native AOT Ready: Optimized for ahead-of-time compilation with minimal cold starts
  • High Performance: Pre-compiled serialization contexts and optimized request/response handling
  • OpenAPI Support: Optional OpenAPI/Swagger integration with Scalar UI
  • Flexible Routing: Standard ASP.NET Core routing with full endpoint mapping capabilities
  • Authentication Support: Built-in support for JWT, IAM, and custom authorizers
  • Minimal Boilerplate: Simple, functional-style configuration with sensible defaults

Basic Usage

using Goa.Functions.ApiGateway;
using Goa.Functions.Core;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.Text.Json;
using System.Text.Json.Serialization;

await Host.CreateDefaultBuilder()
    .UseLambdaLifecycle()
    .ForAspNetCore(app =>
    {
        app.UseRouting();
        app.UseEndpoints(endpoints =>
        {
            endpoints.MapGet("/hello", () => "Hello from Lambda!");
            endpoints.MapPost("/users", async (User user, HttpContext context) => 
            {
                context.Response.StatusCode = 201;
                context.Response.Headers.Location = $"/users/{user.Id}";
                await JsonSerializer.SerializeAsync(context.Response.Body, user, AppJsonContext.Default.User);
            });
        });
    }, apiGatewayType: ApiGatewayType.HttpV2)
    .WithServices(services =>
    {
        services.ConfigureHttpJsonOptions(options =>
        {
            options.SerializerOptions.TypeInfoResolver = AppJsonContext.Default;
        });
    })
    .RunAsync();

public record User(int Id, string Name);

[JsonSourceGenerationOptions(WriteIndented = false)]
[JsonSerializable(typeof(User))]
public partial class AppJsonContext : JsonSerializerContext;

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 52 8/23/2025
0.0.2-preview.2.3 120 8/18/2025
0.0.2-preview.2.2 129 8/17/2025
0.0.2-preview.2.1 87 8/17/2025
0.0.2-preview.2 202 8/9/2025
0.0.0-alpha.0.32 142 12/7/2024
0.0.0-alpha.0.29 95 12/4/2024
0.0.0-alpha.0.20 101 10/27/2024