Skip to content

Instantly share code, notes, and snippets.

@benaadams
Last active August 20, 2017 16:03
Show Gist options
  • Save benaadams/47d3ba1d18a9fe35c495636812ced983 to your computer and use it in GitHub Desktop.
Save benaadams/47d3ba1d18a9fe35c495636812ced983 to your computer and use it in GitHub Desktop.
Microservice
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();
}
@alexsandro-xpt
Copy link

Is this work fine? Really interesting. I see that https://gist.github.com/benaadams/f8f5b3ea3354643b954f102fb778f191 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment