Skip to content

Instantly share code, notes, and snippets.

@emersonsoares
Created March 7, 2017 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emersonsoares/5e43f908e64e1f2c4b8f00e2086177ae to your computer and use it in GitHub Desktop.
Save emersonsoares/5e43f908e64e1f2c4b8f00e2086177ae to your computer and use it in GitHub Desktop.
Minimum configuration web api in AspNetCore
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