-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afa0fbc
commit 099d732
Showing
1 changed file
with
4 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} |