Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Class RouteAU

A Route Configurator for AURequests.

Hierarchy

Implements

Index

Constructors

Handler Properties

Other Properties

Constructors

constructor

  • A Route Configurator for AURequests.

    Parameters

    • __namedParameters: Route
      • Methods: ("GET" | "POST" | "PUT" | "DELETE" | "MIDDLEWARE")[]
      • Scheme: String
      • Sub: String[]
      • Merge: false | true | "GET" | "POST" | "PUT" | "DELETE" | "MIDDLEWARE"
      • Limits: String[]
      • Doc: Doc
      • POST: function
      • PUT: function
      • DELETE: function
      • MID: function
      • GET: function
      • Private: boolean

    Returns RouteAU

Handler Properties

GET

GET: QueryAU

A GET handler for this Auth-Route.

POST

POST: QueryAU

A POST handler for this Auth-Route.

PUT

PUT: QueryAU

A PUT handler for this Auth-Route.

DELETE

DELETE: QueryAU

A DELETE handler for this Auth-Route.

MID

MID: QueryAU

A DELETE handler for this Auth-Route.

Other Properties

Links

Links: string[]

A list of Request Paths used for linking RouteDB requests.

Name

Name: string
inheritdoc

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"
      }),
    }
  }
});

Private

Private: boolean

true, if this Endpoint is restricted to Admins.