Mamba 0.1.0-preview
This is a prerelease version of Mamba.
dotnet add package Mamba --version 0.1.0-preview
NuGet\Install-Package Mamba -Version 0.1.0-preview
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="Mamba" Version="0.1.0-preview" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mamba" Version="0.1.0-preview" />
<PackageReference Include="Mamba" />
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 Mamba --version 0.1.0-preview
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Mamba, 0.1.0-preview"
#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 Mamba@0.1.0-preview
#: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=Mamba&version=0.1.0-preview&prerelease
#tool nuget:?package=Mamba&version=0.1.0-preview&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Mamba
A minimal, AOT-compatible HTTP server for .NET.
Quick Start
var router = new ReqRouter.Builder()
.MapGet("/hello", () => "Hello, world!")
.Build();
var server = HttpServer.Start("http://127.0.0.1:5000", router);
await server.WaitForReadyAsync();
Console.WriteLine("Press Ctrl+C to stop");
Console.CancelKeyPress += (_, e) => { e.Cancel = true; server.Stop(); };
await server.ServerTask;
Routing
var router = new ReqRouter.Builder()
// Simple string response
.MapGet("/", () => "Home")
// Access request data
.MapGet("/greet", req => $"Hello from {req.Path}")
// Async handler
.MapGet("/async", async () => await FetchDataAsync())
// Full control over request/response
.Map("POST", "/api/data", async (req, res) =>
{
res.StatusCode = 201;
res.Headers["X-Custom"] = "value";
await res.WriteAsync("Created");
})
.Build();
Server Lifecycle
// Start returns immediately with a handle
var server = HttpServer.Start("http://127.0.0.1:5000", router);
// Wait until server is accepting connections
await server.WaitForReadyAsync();
// Stop gracefully
await server.StopAsync();
// Or use the blocking API
await HttpServer.Listen("http://127.0.0.1:5000", router, cancellationToken);
AOT Publishing
dotnet publish -c Release
The library is fully AOT-compatible with no reflection.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
-
net10.0
- No dependencies.
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.1.0-preview | 86 | 3/30/2026 |