mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
aee3c489ed
Former-commit-id: 685b296f62c63f98455dce36ce52989be772ba34
39 lines
1.1 KiB
C#
39 lines
1.1 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, IWebHostEnvironment env)
|
|
{
|
|
var routeBuilder = new RouteBuilder(app);
|
|
routeBuilder.MapGet("api/values/{id}", context =>{
|
|
return context.Response.WriteAsync("value");
|
|
});
|
|
var routes = routeBuilder.Build();
|
|
app.UseRouter(routes);
|
|
}
|
|
}
|
|
}
|