Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/makspll/pathfinder
HTTP Route discovery tool for .NET core and .NET Framework web projects
https://github.com/makspll/pathfinder
dotnet dotnet-core dotnet-framework dotnet-web route-discovery static-analysis web
Last synced: 15 days ago
JSON representation
HTTP Route discovery tool for .NET core and .NET Framework web projects
- Host: GitHub
- URL: https://github.com/makspll/pathfinder
- Owner: makspll
- License: mit
- Created: 2024-09-07T19:03:24.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-28T11:55:37.000Z (17 days ago)
- Last Synced: 2024-10-28T12:52:15.014Z (17 days ago)
- Topics: dotnet, dotnet-core, dotnet-framework, dotnet-web, route-discovery, static-analysis, web
- Language: C#
- Homepage:
- Size: 1.34 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pathfinder
Finds and outputs all API routes found in a .NET assembly in textual or JSON format.
## Features
- Attribute based routing
- Conventional routing (templates + defaults have to be specified in a config file)
- .NET core support
- .NET framework support
- JSON and Text output
- Configurable backing lib for projects with custom routing mechanisms# Installation
## Prerequisites
- .NET 7 or later installed (only for running CLI, not in your project)## CLI
- `dotnet tool install -g Makspll.Pathfinder`# Usage
```
pathfinder --help
dotnet build your-project
pathfinder **/bin/**/yourdllname.dll -o Text
```![image](https://i.imgur.com/2Oz4HJA.png)
# Configuration
## Config file
The program is configured via `pathfinder.json` files found in your project. If the file is not found you can specify a path via the `-c` flag.Currently the file needs to specify all your conventional routing configuration (anything that isn't attribute based).
### .NET framework
In .NET framework projects, you will need to specify whether each of your routes is an MVC or API route. This is done by adding a `Type` field to each route in the config file.```json
{
"ConventionalRoutes": [
{
"Template": "conventionalprefix/{controller}/{action}",
"Type": "MVC"
},
{
"Template": "conventionalprefix2/{controller}",
"Defaults": {
"action": "DefaultAction"
},
"Type": "MVC"
},
{
"Template": "conventionalwithnoactionspecs",
"Defaults": {
"controller": "DefaultConventional",
"action": "DefaultAction"
},
"Type": "MVC"
},
{
"Template": "apiconventionalprefix/{controller}/{action}",
"Type": "API"
},
{
"Template": "apiconventionalprefix2/{controller}",
"Defaults": {
"action": "DefaultAction"
},
"Type": "API"
},
{
"Template": "apiconventionalwithnoactionspecs",
"Defaults": {
"controller": "ApiDefaultConventionalApi",
"action": "DefaultAction"
},
"Type": "API"
}
]
}
```### .NET core
.NET core does not make such a distinction, you shouldn't specify the type of controller:
```json
{
"ConventionalRoutes": [
{
"Template": "conventionalprefix/{controller}/{action}"
},
{
"Template": "conventionalprefix2/{controller}",
"Defaults": {
"action": "DefaultAction"
}
},
{
"Template": "conventionalwithnoactionspecs",
"Defaults": {
"controller": "DefaultConventional",
"action": "DefaultAction"
}
}
]
}
```