Program.cs 975 B

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