Program.cs 1.0 KB

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