2017-11-02 04:54:33 +01:00
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-23 04:53:49 +02:00
|
|
|
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
2017-11-02 04:54:33 +01:00
|
|
|
|
{
|
|
|
|
|
var routeBuilder = new RouteBuilder(app);
|
|
|
|
|
routeBuilder.MapGet("api/values/{id}", context =>{
|
|
|
|
|
return context.Response.WriteAsync("value");
|
|
|
|
|
});
|
|
|
|
|
var routes = routeBuilder.Build();
|
|
|
|
|
app.UseRouter(routes);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|