Last active
August 20, 2017 16:03
-
-
Save benaadams/47d3ba1d18a9fe35c495636812ced983 to your computer and use it in GitHub Desktop.
Microservice
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.Hosting; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.DependencyInjection; | |
public class Microservice : Controller | |
{ | |
[HttpGet("/")] | |
public string Hello() => "Hello World"; | |
public void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
=> app.UseMvc(); | |
public void ConfigureServices(IServiceCollection services) | |
=> services.AddMvc(); | |
private static void Main(string[] args) | |
=> WebHost.CreateDefaultBuilder(args) | |
.UseStartup<Microservice>() | |
.Build().Run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this work fine? Really interesting. I see that https://gist.github.com/benaadams/f8f5b3ea3354643b954f102fb778f191 too.