Created
March 7, 2017 21:25
-
-
Save emersonsoares/5e43f908e64e1f2c4b8f00e2086177ae to your computer and use it in GitHub Desktop.
Minimum configuration web api in AspNetCore
This file contains hidden or 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
public static class Program | |
{ | |
public static void Main(string[] args) => new WebHostBuilder() | |
.UseKestrel() | |
.UseUrls("http://localhost:5000") | |
.ConfigureServices(services => services.AddRouting()) | |
.Configure(app => | |
app.UseRouter(router => | |
router.MapGet("hello", | |
async handler => await handler.Response.WriteAsync("Hello World!")))) | |
.Build() | |
.Run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment