Acerca de
Servidor web ligero e integrable, escrito íntegramente en C#, con pocas dependencias de bibliotecas de terceros.
Sistemas e infraestructuraCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +3
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalGenHTTP Webserver
GenHTTP is a lightweight, modular web server written in pure C# with a strong focus on developer experience. The main purpose of this project is to quickly create web services written in .NET 10 / 11, allowing developers to concentrate on the functionality rather than on messing around with configuration files or complex concepts.
Getting Started
To host a GenHTTP server instance in an existing or new .NET project, add a nuget reference to GenHTTP.Full to your
project and spin off a new host:
using GenHTTP.Engine.Internal;
using GenHTTP.Modules.ApiBrowsing;
using GenHTTP.Modules.Functional;
using GenHTTP.Modules.Layouting;
using GenHTTP.Modules.OpenApi;
using GenHTTP.Modules.Practices;
// use a handler of your choice (see the samples below)
var api = Inline.Create()
.Get((int a, int b) => a + b);
var app = Layout.Create()
.Add(api)
.AddOpenApi()
.AddScalar();
var host = await Host.Create()
.Handler(app)
.Defaults()
.StartAsync(); // or .RunAsync() to block until the (console) application is shut down
Running this snippet will provide the following endpoints:
| Endpoint | Description |
|---|---|
| http://localhost:8080/?a=1&b=2 | Serves the API, answering requests by calculating the sum of two query arguments. |
| http://localhost:8080/openapi.json | Serves the automatically generated Open API specification of the API. |
| http://localhost:8080/scalar/ | Servers a graphical viewer of the API, using Scalar. |
Samples
The samples on the website show the frameworks, handlers and concerns of GenHTTP as complete programs, and let you send requests to them as they run live. See the documentation for all available capabilities.
Agentic Coding
GenHTTP’s modules are decoupled and wired together explicitly, with no hidden magic, so every part of an application can be understood by reading its code. This makes GenHTTP a strong fit for agentic coding in C#, where AI agents can reliably understand, change and extend projects without unexpected side effects. GenHTTP Lambda uses those properties to build an agentic coding platform on top of GenHTTP.
Engines
GenHTTP runs on different runtime implementations that can simply be switched by changing a single nuget package
reference and a using statement. Engines are tested to be compatible with all modules, so you can switch the runtime
without any further adjustments.
| Engine | Protocols | Performance | Use Cases |
|---|---|---|---|
| Internal | 1.1 |
Embedding; web applications behind reverse proxy | |
| Kestrel | 1.1 2 3 |
Web applications on the edge | |
| ioxide | 1.1 2 3 |
High performance web applications on Linux via io_uring |
Support
If you encounter issues implementing your application, feel free to join our Discord community to get help. For commercial products and projects, GenHTTP provides additional support options on request.
Building the Server
To build the server from source, clone this repository and run the playground project launcher for .NET 11:
git clone https://github.com/Kaliumhexacyanoferrat/GenHTTP.git
cd ./GenHTTP/Playground
dotnet run
This will build the playground project launcher with all the server dependencies and launch the server process on port 8080.
History
The web server was originally developed in 2008 to run on a netbook with an Intel Atom processor. Both IIS and Apache failed to render dynamic pages on such a slow CPU back then. The original project description can still be found on archive.org. In 2019, the source code has been moved to GitHub with the goal to rework the project to be able to run dockerized web applications written in C#. In 2024 the focus has shifted towards API development, dropping support for generating graphical web applications. In 2026, the API and internal engine have been rewritten to be allocation-free, greatly improving performance in result.
Thanks
- Powered by .NET and the .NET Web Stack
- Modules implemented with ioxide | NSwag | Cottle | SharpCompress
- Monitored by HTTP Arena and HTTP 1.1 Probe
Supported by
Explorar proyectos relacionados
Cargando…
