Created
September 4, 2018 13:15
-
-
Save p-/c9e98b83e9fbd6394a3e4e5ce106d12a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Http; | |
namespace SimpleTestServer_DotNet | |
{ | |
public static class SimpleTestServer | |
{ | |
public static void Main(string[] args) => | |
WebHost.CreateDefaultBuilder(args).UseStartup<Startup>().Build().Run(); | |
} | |
public class Startup | |
{ | |
public void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
{ | |
app.Run(async context => | |
{ | |
context.Response.Headers.Add("Content-Type", "application/json"); | |
await context.Response.WriteAsync("{ \"path\":\"" + context.Request.Path + "\" }"); | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment