GithubHelp home page GithubHelp logo

ediwang / edi.routedebugger Goto Github PK

View Code? Open in Web Editor NEW
47.0 3.0 7.0 176 KB

ASP.NET Core Middleware to show current route info and all routes

License: MIT License

C# 52.09% HTML 34.52% CSS 11.46% JavaScript 1.92%
asp-net-core

edi.routedebugger's Introduction

ASP.NET Core RouteDebugger Middleware

.NET Core

Show current route info and all routes in an ASP.NET Core application

Background

Inspired by .NET Framework version of the origional RouteDebugger: https://haacked.com/archive/2008/03/13/url-routing-debugger.aspx/

We need something similar in .NET Core, with a few differences:

  • Add route info in response header instead of append them in HTML
  • Use JSON over HTML table for better tooling support
  • Use Middleware to make it .NET Corelish

Usage

Install From NuGet

dotnet add package Edi.RouteDebugger

Adding the Middleware

Recommend use in development environment ONLY

If you are using the Developer Exception Page middleware, put this middleware BEFORE the call to app.UseDeveloperExceptionPage() as the exception page would not work otherwise.

if (env.IsDevelopment())
{
    app.UseRouteDebugger();
}

You can also use an overload to specify custom path where the route debugger will be available, for example:

if (env.IsDevelopment())
{
    app.UseRouteDebugger("/tools/route-debugger");
}

View Current Route

  • Open any page in your application
  • View response header x-aspnet-route

View All Routes

  • Access /route-debugger or your custom path from browser or postman

免责申明

此项目(Edi.RouteDebugger)及其配套组件均为免费开源的产品,仅用于学习交流,并且不直接向**提供服务,**用户请于下载后立即删除。

任何**境内的组织及个人不得使用此项目(Edi.RouteDebugger)及其配套组件构建任何形式的面向**境内用户的网站或服务。

不可用于任何违反中华人民共和国(含**省)或使用者所在地区法律法规的用途。

因为作者即本人仅完成代码的开发和开源活动(开源即任何人都可以下载使用),从未参与用户的任何运营和盈利活动。

且不知晓用户后续将程序源代码用于何种用途,故用户使用过程中所带来的任何法律责任即由用户自己承担。

《开源软件有漏洞,作者需要负责吗?是的!》

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.