mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
986 B
37 lines
986 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Net.Http;
|
|
using System.Web.Http;
|
|
using System.Web.Http.Description;
|
|
using ZeroLevel.Models;
|
|
using ZeroLevel.Network;
|
|
|
|
namespace ZeroLevel.Discovery
|
|
{
|
|
public class RoutesController :
|
|
BaseController
|
|
{
|
|
[HttpGet]
|
|
[Route("favicon.ico")]
|
|
public HttpResponseMessage favicon(HttpRequestMessage request)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
[HttpGet]
|
|
[Route("api/v0/routes")]
|
|
[ResponseType(typeof(IEnumerable<ServiceEndpointsInfo>))]
|
|
public HttpResponseMessage GetRoutes(HttpRequestMessage request)
|
|
{
|
|
try
|
|
{
|
|
return request.CreateSelfDestroyingResponse(Injector.Default.Resolve<RouteTable>().Get());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Log.Error(ex, "Error with read records");
|
|
return BadRequestAnswer(request, ex);
|
|
}
|
|
}
|
|
}
|
|
} |