Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Callable

  • Parameters

    Returns any

Index

Properties

all

all: IRouterMatcher<this>

Special-cased "all" method, applying the given route path, middleware, and callback to every HTTP method.

checkout

checkout: IRouterMatcher<this>

connect

connect: IRouterMatcher<this>

copy

copy: IRouterMatcher<this>

delete

delete: IRouterMatcher<this>

get

get: IRouterMatcher<this>

head

head: IRouterMatcher<this>

lock

lock: IRouterMatcher<this>

m-search

m-search: IRouterMatcher<this>

merge

merge: IRouterMatcher<this>

mkactivity

mkactivity: IRouterMatcher<this>

mkcol

mkcol: IRouterMatcher<this>

move

move: IRouterMatcher<this>

notify

notify: IRouterMatcher<this>

options

options: IRouterMatcher<this>

patch

patch: IRouterMatcher<this>

post

post: IRouterMatcher<this>

propfind

propfind: IRouterMatcher<this>

proppatch

proppatch: IRouterMatcher<this>

purge

purge: IRouterMatcher<this>

put

put: IRouterMatcher<this>

report

report: IRouterMatcher<this>

search

search: IRouterMatcher<this>

stack

stack: any[]

Stack of configured routes

subscribe

subscribe: IRouterMatcher<this>

trace

trace: IRouterMatcher<this>

unlock

unlock: IRouterMatcher<this>

unsubscribe

unsubscribe: IRouterMatcher<this>

use

use: IRouterHandler<this> & IRouterMatcher<this>

Methods

param

  • Map the given param placeholder name(s) to the given callback(s).

    Parameter mapping is used to provide pre-conditions to routes which use normalized placeholders. For example a :user_id parameter could automatically load a user's information from the database without any additional code,

    The callback uses the samesignature as middleware, the only differencing being that the value of the placeholder is passed, in this case the id of the user. Once the next() function is invoked, just like middleware it will continue on to execute the route, or subsequent parameter functions.

     app.param('user_id', function(req, res, next, id){
       User.find(id, function(err, user){
         if (err) {
           next(err);
         } else if (user) {
           req.user = user;
           next();
         } else {
           next(new Error('failed to load user'));
         }
       });
     });

    Parameters

    Returns this

  • Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param()

    deprecated

    since version 4.11

    Parameters

    Returns this

route

  • Parameters

    Returns IRoute

Generated using TypeDoc