Program.cs 984 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Threading;
  3. using Microsoft.AspNetCore.Builder;
  4. using Microsoft.AspNetCore.Hosting;
  5. using Microsoft.Extensions.Hosting;
  6. namespace PeachpieBenchmarks.Server
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. // Double ThreadPool for non-async calls
  13. ThreadPool.GetMinThreads(out int workerThread, out int completionThread);
  14. ThreadPool.SetMinThreads(workerThread * 2, completionThread);
  15. new WebHostBuilder()
  16. .UseKestrel()
  17. .UseUrls("http://*:8080/")
  18. .UseStartup<Startup>()
  19. .Build()
  20. .Run();
  21. }
  22. }
  23. class Startup
  24. {
  25. public void Configure(IApplicationBuilder app)
  26. {
  27. // app.UseResponseBuffering();
  28. app.UsePhp(new PhpRequestOptions(scriptAssemblyName: "Website"));
  29. // app.UseDefaultFiles();
  30. // app.UseStaticFiles();
  31. }
  32. }
  33. }