AromaSharp 1.0.0
dotnet add package AromaSharp --version 1.0.0
NuGet\Install-Package AromaSharp -Version 1.0.0
<PackageReference Include="AromaSharp" Version="1.0.0" />
<PackageVersion Include="AromaSharp" Version="1.0.0" />
<PackageReference Include="AromaSharp" />
paket add AromaSharp --version 1.0.0
#r "nuget: AromaSharp, 1.0.0"
#:package AromaSharp@1.0.0
#addin nuget:?package=AromaSharp&version=1.0.0
#tool nuget:?package=AromaSharp&version=1.0.0
AromaSharp — Lightweight C# Web Framework
AromaSharp is a small, expressive web framework for .NET inspired by the simplicity of microframeworks.
It provides an Express and Aroma.js like API for routing, middleware, static files, simple templating, sessions, and body parsing — all in a single minimal library you can reference in your projects.
Features
get,post,put,delete,allroute helpers- Middleware pipeline with
use(...) parseBody()middleware to populatereq.Body(JSON & form-urlencoded)- Rate limiter and logger middlewares
- Module mounting from DLLs (
mount(...))
Quick start
Example Program.cs using AromaSharp API:
using System;
using AromaSharp;
class Program
{
static void Main(string[] args)
{
var app = new Aroma();
// Enable body parsing middleware so req.body is available in POST handlers
app.parseBody();
// Log all requests
app.logger();
// Simple GET
app.get("/", async (req, res, next) =>
{
await res.send("Hello from AromaSharp!");
});
// POST that expects JSON or form data
app.post("/echo", async (req, res, next) =>
{
// req.body will be populated by parseBody() middleware
await res.json(new { received = req.body, query = req.query });
});
// Start listening (blocks the thread)
app.listen(5000, () => Console.WriteLine("AromaSharp running at http://localhost:5000"));
}
}
API Reference (selected)
Aroma (main app)
new Aroma()— create app instanceuse(middleware)— add middleware:async (req, res, next) => { ...; await next(); }use(path, router)— mount sub-router at pathget/post/put/delete/all(path, handlers...)— register routesparseBody()— enable automatic parsing of JSON orapplication/x-www-form-urlencodedserveStatic(directory)— serve files from directorymount(directory)— load.dllmodules implementingIAromaModulelogger()— attach request logger middlewarerateLimiter(options)— attach rate limiter middlewarelisten(port, started)— start server (blocking)stop()— stop server
Request req
req.Path,req.Url,req.HttpMethodreq.Query— query string dictionaryreq.Params— route params from:paramstyle routesreq.Body— populated byparseBody()(Dictionary<string, object> for JSON/form)req.Cookies— cookie dictionary
Response res
res.status(code)— set status code (returnsres)res.setHeader(name, value)— set headerres.send(string)/res.send(byte[], contentType)— write bodyres.json(object)— serialize to JSON and sendres.redirect(url)/res.redirect(status, url)res.cookie(name, value, options)— set cookie
Body parsing
Call app.parseBody() once during setup and all route handlers will have req.body populated for requests with:
Content-Type: application/json(deserializes toDictionary<string, object>)Content-Type: application/x-www-form-urlencoded(parsed intoDictionary<string, object>)
Example client request JSON:
{
"name": "Aavesh",
"email": "aavesh@example.com"
}
In your handler:
var name = req.body["name"] : null;
Contributing
Contributions welcome — open an issue or PR for enhancements (routing features, multipart parser, template improvements, etc.).
License
MIT © Aavesh Jilani
| Product | Versions 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. |
-
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.0.0 | 210 | 8/13/2025 |