{"id":16624403,"url":"https://github.com/bruno-garcia/shortr","last_synced_at":"2025-08-22T15:31:32.918Z","repository":{"id":85886756,"uuid":"231470464","full_name":"bruno-garcia/shortr","owner":"bruno-garcia","description":"URL shortener and redirection","archived":false,"fork":false,"pushed_at":"2024-05-09T15:29:46.000Z","size":66,"stargazers_count":12,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-16T11:46:34.572Z","etag":null,"topics":["aspnetcore","library","shorten-urls"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bruno-garcia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-02T22:36:31.000Z","updated_at":"2024-05-21T15:46:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"eab5d34b-d504-47a8-aa7f-e6c968b3b851","html_url":"https://github.com/bruno-garcia/shortr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruno-garcia%2Fshortr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruno-garcia%2Fshortr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruno-garcia%2Fshortr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bruno-garcia%2Fshortr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bruno-garcia","download_url":"https://codeload.github.com/bruno-garcia/shortr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230611482,"owners_count":18253230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aspnetcore","library","shorten-urls"],"created_at":"2024-10-12T03:46:20.791Z","updated_at":"2024-12-20T15:58:50.217Z","avatar_url":"https://github.com/bruno-garcia.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shortr\n\n[![Travis](https://travis-ci.org/bruno-garcia/shortr.svg?branch=master)](https://travis-ci.org/bruno-garcia/shortr/builds/632765857)\n[![AppVeyor](https://ci.appveyor.com/api/projects/status/9i9o95vv30224bl6?svg=true)](https://ci.appveyor.com/project/bruno-garcia/shortr)\n[![Tests](https://img.shields.io/appveyor/tests/bruno-garcia/shortr/master?compact_message)](https://ci.appveyor.com/project/bruno-garcia/shortr/branch/master/tests)\n[![codecov](https://codecov.io/gh/bruno-garcia/shortr/branch/master/graph/badge.svg)](https://codecov.io/gh/bruno-garcia/shortr)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9a5ba18bcceb4dcfbb9fffd2fcd2196d)](https://www.codacy.com/manual/bruno-garcia/shortr?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=bruno-garcia/shortr\u0026amp;utm_campaign=Badge_Grade)\n\n|      Package             |     NuGet      |\n| ----------------------------- | :-------------------: |\n|         **Shortr**            | [![Downloads](https://img.shields.io/nuget/dt/Shortr.svg)](https://www.nuget.org/packages/Shortr) |   [![NuGet](https://img.shields.io/nuget/vpre/Shortr.svg)](https://www.nuget.org/packages/Shortr)   |\n|         **Shortr.AspNetCore**            | [![Downloads](https://img.shields.io/nuget/dt/Shortr.AspNetCore.svg)](https://www.nuget.org/packages/Shortr.AspNetCore) |   [![NuGet](https://img.shields.io/nuget/vpre/Shortr.AspNetCore.svg)](https://www.nuget.org/packages/Shortr.AspNetCore)   |\n|         **Shortr.Npgsql**            | [![Downloads](https://img.shields.io/nuget/dt/Shortr.Npgsql.svg)](https://www.nuget.org/packages/Shortr.Npgsql) |   [![NuGet](https://img.shields.io/nuget/vpre/Shortr.Npgsql.svg)](https://www.nuget.org/packages/Shortr.Npgsql)   |\n\n## A .NET Library for URL shortening and request redirection\nThis project can create short URLs (i.e: [https://nugt.net/s/FqJFMC2](https://nugt.net/s/FqJFMC2)) and redirect requests to the original URL.\n\nYou can see it in use [in the NuGetTrends source code](https://github.com/NuGetTrends/nuget-trends).\n\n### How does it work\nIt offers an in-memory store, for testing. And a [Postgres extension package](https://github.com/bruno-garcia/shortr/tree/master/src/Shortr.Npgsql) \nand an [ASP.NET Core extension](https://github.com/bruno-garcia/shortr/tree/master/src/Shortr.AspNetCore) to plug it into the request pipeline. \n \nIt also includes a [web app](https://github.com/bruno-garcia/shortr/tree/master/src/Shortr.Web) to demonstrate its use from a JavaScript client.\n\n### Configuration\nBy default it only generates links to URLs sharing the same `BaseAddress` as configured for the application itself.\nIt's possible to change this behavior in different ways.\n\nFor example, allowing a direct URL to be created to any destination:\n\n```csharp\nvar options = new ShortrOptions \n{\n  AllowRedirectToAnyDomain = true\n}\n```\n\nThe other [options can be found here](https://github.com/bruno-garcia/shortr/blob/master/src/Shortr/ShortrOptions.cs).\n\n### Run the Web project\nMake sure you have [.NET Core 3](https://dot.net), `docker` and `docker-compose` to run `PostgreSQL`:\n\n    1. Start postgres with `docker-compose up`\n    2. Navigate to `src\\Shortr.Web` and run `dotnet run`\n    3. Browser `http://localhost:5000`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbruno-garcia%2Fshortr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbruno-garcia%2Fshortr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbruno-garcia%2Fshortr/lists"}