Skip to content
Instacode

Make Routing a First Class Citizen in your Web Application

Bring the benefits of super flexible, ultra-expressive graph based routing to your Asp.Net, Web API and Owin project with Superscribe

Why Superscribe? Superscribe is not your average routing framework.

Feature 1

Hierarchical Routes

Superscribe routes are defined hierarchically for ease of maintenance and efficient matching

Feature 2

Re-usable Definitions

Each route segment definition is strongly typed... reduce code duplication by composing and re-using them however you like

Feature 3

Flexible Approach

Like to have your routes defined near your handlers? Not a problem. Like to define routes centrally all in one place? That's fine.

Feature 4

No Limits

Execute arbitrary code as part of your routing pipeline to match routes, make choices or return responses using simple syntax... the possibilities are endless!

Getting Started How do you want to define your routes?

Superscribe Core

PM> Install-Package Superscribe

Owin

PM> Install-Package Superscribe.Owin

Web Api

PM> Install-Package Superscribe.WebApi

Web Api - Owin Hosted

PM> Install-Package Superscribe.WebApi.Owin

Web Api

Superscribe integrates seamlessly with Asp.Net Web Api, working nicely alongside any existing attribute or traditonal routes.


  public static class WebApiConfig
  {
      public static void Register(HttpConfiguration config)
      {
          var define = SuperscribeConfig.Register(config);
          // or for module support use: .RegisterModules(config);

          define.Route("api" / Any.Controller / (Int)"id");
      }
  }
        

Modules

Any classes in your app that derive from SuperscribeModule or SuperscribeOwinModule will be automatically picked up and wired into your routing.


  // Web Api
  public class HelloWorldModule : SuperscribeModule
  {
      public HelloWorldModule()
      {
          this.Get["/"] = o => "Hello World!";
      }
  }

  // Owin
  public class HelloWorldModule : SuperscribeOwinModule
  {
      public HelloWorldModule()
      {
          this.Get["/"] = o => "Hello Owin!";
      }
  }
        

Owin Router

Let your routing decide which middleware to include in your Owin pipeline.


  public class Startup
  {
      public void Configuration(IAppBuilder app)
      {
          var define = OwinRouteEngineFactory.Create();
          app.UseSuperscribeRouter(define);

          // Set up a branch that will include auth middleware when going through /admin
          define.Pipeline("Api/Admin").Use<AuthMiddleware>();

          // Set up a branch that will swap out repositories with in-memory versions for testing
          define.Pipeline("Api/Debug").Use<DebugDependencies>();
      }
  }
        

Owin Handler

Bulky web frameworks just slowing you down? With Superscribe you can respond to simple requests without one.


  public class Startup
  {
      public void Configuration(IAppBuilder app)
      {
          var define = OwinRouteEngineFactory.Create();
          app.UseSuperscribeRouter(define)
              .UseSuperscribeHandler(define);

          define.Get("Hello/World", o => "Hello World");
      }
  }