using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Http; namespace netcore { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } public void ConfigureServices(IServiceCollection services) { services.AddRouting(); } public void Configure(IApplicationBuilder app, IHostingEnvironment env) { var routeBuilder = new RouteBuilder(app); routeBuilder.MapGet("api/values/{id}", context =>{ return context.Response.WriteAsync("value"); }); var routes = routeBuilder.Build(); app.UseRouter(routes); } } }