https://github.com/ignatandrei/netcoreshortlinks
.NET Core short links
https://github.com/ignatandrei/netcoreshortlinks
Last synced: about 1 year ago
JSON representation
.NET Core short links
- Host: GitHub
- URL: https://github.com/ignatandrei/netcoreshortlinks
- Owner: ignatandrei
- License: mit
- Created: 2023-04-03T18:45:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-05T21:50:51.000Z (over 3 years ago)
- Last Synced: 2025-06-09T13:09:10.384Z (about 1 year ago)
- Language: C#
- Size: 38.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NetCoreShortLinks
.NET Core short links - short links for your site
[](https://github.com/ignatandrei/NetCoreShortLinks/actions/workflows/dotnet.yml)

# How to use it
Install the package from https://www.nuget.org/packages/NetCore7ShortLinks
Use the following code for .NET 7
```csharp
builder.Services.AddShortUrl();
//code
app.UseShortUrl();
app.UseDefaultFiles();
app.UseStaticFiles();
//code
app.MapControllers();
app.MapShortUrlEndpoints();
```
# What it does
It adds a middleware that creates short url for each response that matches 200 and content type text/html.
You can see the list at /short/list/json
You can follow a short url from /short/goto/{shorturl}
# Github
https://github.com/ignatandrei/NetCoreShortLinks