Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dotnet test Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj -f net11.0 \
# Only one engine (Internal | Kestrel | Ioxide)
TEST_ENGINE=Internal dotnet test Testing/Acceptance/GenHTTP.Testing.Acceptance.csproj -f net11.0

cd Playground && dotnet run # sample server on http://localhost:8080
cd Playground && dotnet run # minimal app on http://localhost:8080
```

- Filter with `FullyQualifiedName~...`. `ClassName=Foo` silently matches nothing.
Expand All @@ -49,7 +49,7 @@ cd Playground && dotnet run # sample server on ht
| `Testing/Acceptance` | The test suite. Folder structure mirrors `API/`, `Engine/`, `Modules/`, `Adapters/`. |
| `Benchmarks/` | BenchmarkDotNet micro-benchmarks. |
| `Packages/` | Meta-package `.nuspec` files (`GenHTTP.Core`, `GenHTTP.Full`, and per-engine variants). |
| `Playground/` | Runnable samples for manual checks and for users to understand the API. |
| `Playground/` | A minimal app for manual checks. The samples for users are on the website (genhttp.org/samples). |

The parser (Glyph11) and ioxide are separate projects consumed as NuGet packages. If they are checked
out next to this repository (`../Glyph11`, `../ioxide`), read their source rather than guessing. Flag
Expand Down
7 changes: 3 additions & 4 deletions Playground/Program.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using GenHTTP.Engine.Internal;

using GenHTTP.Modules.IO;
using GenHTTP.Modules.Practices;

using GenHTTP.Playground.Samples;

var sample = LayoutingSample.Create();
var app = Content.From(Resource.FromString("Hello World!"));

return await Host.Create()
.Handler(sample)
.Handler(app)
.Development()
.Defaults()
.RunAsync();
30 changes: 17 additions & 13 deletions Playground/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# GenHTTP Playground

The playground provides code samples for quick reference and allows developers to
quickly validate things.

| Sample | Description |
|----------------------------------------------------------------------|----------------------------------------------------------------------------------|
| [Layouting](./Samples/LayoutingSample.cs) | Allows an app to use multiple handlers by adding routing. |
| [Webservices](./Samples/WebserviceSample.cs) | Implements a REST webservice via a handler class. |
| [Functional](./Samples/FunctionalSample.cs) | Uses delegates to implement a web service (similar to ASP.NET Core Minimal API). |
| [Controllers](./Samples/ControllerSample.cs) | Uses controllers to implement a web service (similar to ASP.NET Core MVC). |
| [MCP Tools](./Samples/McpSample.cs) | Provides tools to AI agents such as Claude via the Model Context Protocol. |
| [Static Files](./Samples/StaticFileSample.cs) | Serves static files from a directory. |
| [Static Websites](./Samples/StaticWebsiteSample.cs) | Hosts a static website (with `index.html` support). |
| [Single Page Applications](./Samples/SinglePageApplicationSample.cs) | Hosts a SPA such as a React or Angular application. |
The playground is a minimal app to quickly try things out while working on GenHTTP.
Change the handler in [Program.cs](./Program.cs) as needed and start the server:

```bash
cd Playground
dotnet run
```

The app is then served at http://localhost:8080/.

## Samples

Samples for the frameworks, handlers and concerns of GenHTTP can be found
[on the website](https://genhttp.org/samples/), where you can read their code and
send requests to them as they run live.

The [Ioxide](./Samples/Ioxide/README.md) folder contains samples for the io_uring based engine.
62 changes: 0 additions & 62 deletions Playground/Samples/ControllerSample.cs

This file was deleted.

81 changes: 0 additions & 81 deletions Playground/Samples/CustomFrameworkSample.cs

This file was deleted.

47 changes: 0 additions & 47 deletions Playground/Samples/FunctionalSample.cs

This file was deleted.

38 changes: 0 additions & 38 deletions Playground/Samples/LayoutingSample.cs

This file was deleted.

78 changes: 0 additions & 78 deletions Playground/Samples/McpSample.cs

This file was deleted.

Loading
Loading