asp net routing add special convention mysitye/string

asp net routing add special convention mysitye/string

Hello I am new with ASP NET MVC

Hello I am new with ASP NET MVC

I have a web page with default routing

        public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

    routes.MapRoute(
        name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    );
}

I have been working developing a URL shortener that creates 5 character strings in base 32 (A-Z 0-9). My idea is to have the default routing in ASP NET MVC and add a special case forwww.mypage.com/ASD12 //this is the random code generated by my application

How can I add this exception to my routing and always make URLs (mypage.test/code) land in a specific controller action

 public class CodeController : Controller
{
   public async Task<ActionResult> Index(string code)
    {//do things here}
}

Thank you very much

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Add asp.net Identity in empty project

LIKE | COMMENT | SHARE | SUBSCRIBE Today, in this tutorial you will see the process of adding an ASP.NET Identity to the ASP.NET Web Application developed in...

List all users from asp net core identity

LIKE | COMMENT | SHARE | SUBSCRIBE In this video, i will show you How to retrieve and display all the registered application users in asp.net core using the ...

Extend IdentityUser in ASP NET Core

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorials, I will show you how to extend IdentityUser in asp.net core.. Subscribe & Stay Connected! Thank You! ♥ #...