Guest User

Untitled

a guest
Jan 16th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. namespace MyApp
  2. {
  3. public class Startup
  4. {
  5. public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
  6. {
  7. app.Run(async context => {
  8. context.Response.StatusCode = 200;
  9. await context.Response.WriteAsync("test");
  10. });
  11. }
  12. }
  13.  
  14. public static class Program
  15. {
  16. public static void Main(string[] args)
  17. {
  18. var app = WebHost.CreateDefaultBuilder(args)
  19. .UseKestrel(options => {
  20. options.Listen(IPAddress.Loopback, 5000);
  21. options.AllowSynchronousIO = false;
  22. })
  23. .UseStartup<Startup>()
  24. .Build();
  25. app.Run();
  26. }
  27. }
  28. }
  29.  
  30. $ dotnet run
  31.  
  32. $ ab -p test.json -n 20000 -c 100 http://127.0.0.1:5000/
Add Comment
Please, Sign In to add comment