Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Class RouteGN<R>

The Base Class for the Route Configurators.

Type parameters

  • R: function | function

Hierarchy

Implements

Index

Constructors

Handler Properties

Other Properties

Methods

Constructors

constructor

  • The Base Class for the Route Configurators.

    Parameters

    • __namedParameters: General
      • Methods: ("GET" | "POST" | "PUT" | "DELETE" | "MIDDLEWARE")[]
      • Sub: String[]
      • Scheme: String
      • Merge: false | true | "GET" | "POST" | "PUT" | "DELETE" | "MIDDLEWARE"
      • Limits: String[]
      • Doc: Doc
      • GET: R
      • POST: R
      • DELETE: R
      • MID: R
      • PUT: R
      • Params: CLParams
      • Parse: Parse
      • Key: String
      • Private: boolean
      • Links: String[]

    Returns RouteGN

Handler Properties

GET

A GET handler for this Route path.

POST

A POST handler for this Route path.

PUT

A PUT handler for this Route path.

DELETE

DELETE: QueryAU | QueryDB

A DELETE handler for this Route path.

MID

MID: QueryAU

A MID handler for this Route path.

Other Properties

Name

Name: string

The name of this route.

Methods

Methods: Array<"GET" | "POST" | "PUT" | "DELETE" | "MIDDLEWARE">

The HTTP-Methods that this Endpoint can be called with. This can be exploited to allow a single-hanlder (GET, for example) repsond to other HMETHODs (such as, POST).

Sub

Sub: string[]

A list of the heirarchy Endpoints contained within it's Base that it belongs under.

By default, any Endpoint defined within a BasePoint -- except, of course, for "/" -- is a direct descendant of "/", as "/" is just the definition of the BasePoint without any other paths following it. But obviously there are needs to push the heirarchy further.

Instead of forcing developers to use a Parant > Child structure that would get very annoying, very fast, heirarchies are defined using this property. As was said earlier, "/", is inherited by all other Endpoints contained with a BaseEndpoint, so it doesn't need to be add here. If the Endpoint in question is to remain a direct descendant of "/", then this need not be defined.

Depending on whether or not Merge is configured, the path will be resolved differently.

Example:

({
  User: {
    Actions: {
      Email: new RouteDB({
        Scheme: '/',
        Merge: true,
        Subs: ['settings'], // defined, child of "Settings", Merge
        // Resolves to "/user/settings/:sttg_id/email"
      }),
      Privacy: new RouteDB({
        Scheme: '/:uid/',
        Subs: ['settings'], // defined, child of "Settings", no Merge
        // Resolves to "/user/settings/privacy/:uid"
      }),
      Settings: new RouteDB({
        Scheme: '/:sttg_id/', ...
        // Sub not defined, is child of "/", no Merge
      }),
      "/": new RouteDB({
        Scheme: '/:uid/', ...
        // Resolves to "/user/:uid"
      }),
    }
  }
});

Links

Links: string[]

A list of Request Paths used for linking RouteDB requests.

Private

Private: boolean

true, if this Endpoint is restricted to Admins.

Private Locked

Locked: boolean

If true, this configuration is now immutable.

Methods

Private Lock

  • Lock(): void
  • Locks the current configuration, permanetly.

    Returns void