LiteAPI.Core 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package LiteAPI.Core --version 1.1.0
                    
NuGet\Install-Package LiteAPI.Core -Version 1.1.0
                    
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="LiteAPI.Core" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LiteAPI.Core" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="LiteAPI.Core" />
                    
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 LiteAPI.Core --version 1.1.0
                    
#r "nuget: LiteAPI.Core, 1.1.0"
                    
#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.
#addin nuget:?package=LiteAPI.Core&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=LiteAPI.Core&version=1.1.0
                    
Install as a Cake Tool

Here is your fully updated, clean, professional README.md for LiteAPI, reflecting all current features without the outdated folder structure:


🚀 LiteAPI

A minimal, dependency-free C# micro web framework for building lightweight REST APIs, internal tools, and microservices without the complexity of heavy frameworks.


✨ Features

Zero dependencies – fully standalone, runs anywhere .NET runs.

Minimal & fast – low overhead, instant startup.

JSON parsing & structured JSON/text responses out of the box.

Lightweight DI container:

  • Singleton, Scoped, Transient lifetimes
  • Auto-inject into request handlers and services

Flexible Routing:

  • Supports GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD
  • Route parameter extraction (e.g., /api/users/{id})
  • Query parsing to objects (?page=1&pageSize=10QueryParams)

Form and JSON body binding:

  • [FromBody], [FromForm], [FromQuery], [FromRoute] support for handler parameters
  • Automatic type binding for DTOs, primitives, and complex models

Async/Await support in handlers for scalable IO-bound operations.

Route grouping (MapGroup<T>) for modular endpoint organization.

Code-based configuration system:

  • LiteConfiguration with project-level initialization
  • Supports Urls, LaunchBrowser, and custom Values
  • Configurable via builder.Configure<MyConfig>()

Static file serving for dashboard/admin tools.

Clear error handling for development and production scenarios.

Predictable, clean architecture for learning and internal tooling.


🚀 Example Usage

using LiteAPI;

var builder = LiteWebApplication.CreateBuilder(args);
builder.Configure<MyConfiguration>();

var app = builder.Build();

app.Get("/", ctx => Response.Ok("Welcome to LiteAPI!"));

app.Get("/api/users/{id}", (HttpListenerRequest req, int id) =>
{
    var user = UserRepository.GetUser(id);
    return user != null ? Response.OkJson(user) : Response.NotFound();
});

app.Post("/api/users", (HttpListenerRequest req, [FromBody] UserDto user) =>
{
    UserRepository.AddUser(user);
    return Response.Created($"/api/users/{user.Id}", user);
});

app.Run();

🛠️ Advanced Features

DI usage example:

builder.Services.AddSingleton<IMyService, MyService>();

app.Get("/service", req =>
{
    var service = req.GetService<IMyService>();
    return Response.Ok(service.DoWork());
});

Query parsing:

app.Get("/api/items", (HttpListenerRequest req, [FromQuery] QueryParams query) =>
{
    var items = ItemRepository.GetPaged(query.Page, query.PageSize, query.Search);
    return Response.OkJson(items);
});

Route grouping:

app.MapGroup<UsersRoutes>("/api/users");

Static files:

app.MapStaticFiles(); // serves from `wwwroot/`

Async handlers:

app.Get("/api/slow", async req =>
{
    await Task.Delay(1000);
    return Response.Ok("Done!");
});

🛡️ Stability & Roadmap

LiteAPI is production-friendly for internal tools and lightweight APIs.

Planned features:

  • Middleware pipeline (logging, auth, CORS)
  • Built-in CORS support
  • Graceful shutdown signals
  • Optional Swagger/OpenAPI integration
  • Rate limiting and caching extensions

🤝 Contributing

Pull requests are welcome! Feel free to open issues for feature requests or bugs.


🪐 License

MIT License


✉️ Contact

For collaboration, consulting, or enterprise support:


Happy building lightweight, productive APIs with LiteAPI!

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 was computed.  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.
  • net9.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
1.1.1 90 7/4/2025
1.1.0 92 7/4/2025
1.0.1 123 7/2/2025
1.0.0 120 7/2/2025