Skip to content

Commit

Permalink
Restore original playground
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaliumhexacyanoferrat committed Oct 17, 2024
1 parent afa0fbc commit 099d732
Showing 1 changed file with 4 additions and 44 deletions.
48 changes: 4 additions & 44 deletions Playground/Program.cs
Original file line number Diff line number Diff line change
@@ -1,52 +1,12 @@
using GenHTTP.Api.Content;
using GenHTTP.Api.Protocol;
using GenHTTP.Engine;
using GenHTTP.Modules.Basics;
using GenHTTP.Modules.Controllers;
using GenHTTP.Modules.Functional;
using GenHTTP.Modules.OpenApi;
using GenHTTP.Engine;
using GenHTTP.Modules.IO;
using GenHTTP.Modules.Practices;
using GenHTTP.Modules.Webservices;

// todo bug: Inline.Get("/") => wirft fehler!

var description = ApiDescription.Create()
.Title("My API")
.Version("1.0.0");

var inline = Inline.Create()
.Put("file", (Stream stream) => true)
.Add(description);
var app = Content.From(Resource.FromString("Hello World"));

Host.Create()
.Handler(inline)
.Handler(app)
.Defaults()
.Development()
.Console()
.Run();

public record User(int ID, string Name);

public class UserService
{

[ResourceMethod]
public Stream Avatar(DateTime cannot, short s, byte b, bool b2) => new MemoryStream();
}

public class DeviceController
{

// [ControllerAction(RequestMethod.Post)]
public void Register(int id)
{

}

[ControllerAction(RequestMethod.Get)]
public IHandlerBuilder Wildcard() => Redirect.To("https://google.de");

[Obsolete]
[ControllerAction(RequestMethod.Get)]
public ValueTask<User?> GetUserAsync() => new();
}

0 comments on commit 099d732

Please sign in to comment.