mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
40f79c1f19
Former-commit-id: d8979e55679bbb586dd79a81a43e1c29082ad9c2
39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|