Program.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using GenHTTP.Engine;
  2. using GenHTTP.Modules.IO;
  3. using GenHTTP.Modules.Layouting;
  4. using GenHTTP.Modules.Webservices;
  5. using Benchmarks.Tests;
  6. using Benchmarks.Utilities;
  7. namespace Benchmarks
  8. {
  9. public static class Program
  10. {
  11. public static int Main(string[] args)
  12. {
  13. var tests = Layout.Create()
  14. .Add("plaintext", Content.From(Resource.FromString("Hello, World!")))
  15. .Add("fortunes", new FortuneHandlerBuilder())
  16. .AddService<JsonResource>("json")
  17. .AddService<DbResource>("db")
  18. .AddService<QueryResource>("queries")
  19. .AddService<UpdateResource>("updates")
  20. .AddService<CacheResource>("cached-worlds")
  21. .Add(ServerHeader.Create());
  22. return Host.Create()
  23. .Handler(tests)
  24. .Run();
  25. }
  26. }
  27. }