Trait

io.scalajs.npm.express

Router

Related Doc: package express

Permalink

trait Router extends Object

A router object is an isolated instance of middleware and routes. You can think of it as a “mini-application,” capable only of performing middleware and routing functions. Every Express application has a built-in app router.

A router behaves like middleware itself, so you can use it as an argument to app.use() or as the argument to another router’s use() method.

The top-level express object has a Router() method that creates a new router object.

Annotations
@RawJSType() @native()
See also

http://expressjs.com/en/4x/api.html#router

Linear Supertypes
Object, Any, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Router
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def all(path: String, callback: Function, callbacks: Function*): Router.this.type

    Permalink

    This method is like the standard app.METHOD() methods, except it matches all HTTP verbs.

    This method is like the standard app.METHOD() methods, except it matches all HTTP verbs. It’s useful for mapping “global” logic for specific path prefixes or arbitrary matches. For example, if you put the following at the top of all other route definitions, it requires that all routes from that point on require authentication, and automatically load a user. Keep in mind that these callbacks do not have to act as end-points: loadUser can perform a task, then call next() to continue matching subsequent routes

    Example:
    1. app.all(path, callback [, callback ...])

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def checkout(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def connect(path: String, callback: Function, callbacks: Function*): Router.this.type

    Permalink

    Routes HTTP CONNECT requests to the specified path with the specified callback functions.

    Routes HTTP CONNECT requests to the specified path with the specified callback functions. For more information, see the routing guide.

    Example:
    1. app.connect(path, callback [, callback ...])

  9. def copy(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  10. def delete(path: String, callback: Function, callbacks: Function*): Router.this.type

    Permalink

    Routes HTTP DELETE requests to the specified path with the specified callback functions.

    Routes HTTP DELETE requests to the specified path with the specified callback functions. For more information, see the routing guide. You can provide multiple callback functions that behave just like middleware, except these callbacks can invoke next('route') to bypass the remaining route callback(s). You can use this mechanism to impose pre-conditions on a route, then pass control to subsequent routes if there’s no reason to proceed with the current route.

    Example:
    1. app.delete(path, callback [, callback ...])

  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def get(path: String, callback: Function, callbacks: Function*): Router.this.type

    Permalink

    Routes HTTP GET requests to the specified path with the specified callback functions.

    Routes HTTP GET requests to the specified path with the specified callback functions. For more information, see the routing guide.

    You can provide multiple callback functions that behave just like middleware, except these callbacks can invoke next('route') to bypass the remaining route callback(s). You can use this mechanism to impose pre-conditions on a route, then pass control to subsequent routes if there’s no reason to proceed with the current route.

    Example:
    1. app.get(path, callback [, callback ...])

  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. def head(path: String, callback: Function, callbacks: Function*): Router.this.type

    Permalink

    Routes HTTP HEAD requests to the specified path with the specified callback functions.

    Routes HTTP HEAD requests to the specified path with the specified callback functions. For more information, see the routing guide.

    Example:
    1. app.head(path, callback [, callback ...])

  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  21. def lock(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  22. def m_search(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
    Annotations
    @JSName( "m-search" )
  23. def merge(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  24. def mkactivity(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  25. def mkcol(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  26. def move(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. def notify(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  29. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  30. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. def options(path: String, callback: Function, callbacks: Function*): Router.this.type

    Permalink

    Routes HTTP OPTIONS requests to the specified path with the specified callback functions.

    Routes HTTP OPTIONS requests to the specified path with the specified callback functions. For more information, see the routing guide.

    Example:
    1. app.options(path, callback [, callback ...])

  32. def param(callback: Function): Unit

    Permalink
  33. def param(names: Array[String], callback: Function): Unit

    Permalink
  34. def param(name: String, callback: Function): Unit

    Permalink

    Add callback triggers to route parameters, where name is the name of the parameter or an array of them, and callback is the callback function.

    Add callback triggers to route parameters, where name is the name of the parameter or an array of them, and callback is the callback function. The parameters of the callback function are the request object, the response object, the next middleware, the value of the parameter and the name of the parameter, in that order.

    If name is an array, the callback trigger is registered for each parameter declared in it, in the order in which they are declared. Furthermore, for each declared parameter except the last one, a call to next inside the callback will call the callback for the next declared parameter. For the last parameter, a call to next will call the next middleware in place for the route currently being processed, just like it would if name were just a string.

    Example:
    1. app.param([name], callback)

  35. def patch(path: String, callback: Function, callbacks: Function*): Router.this.type

    Permalink

    Routes HTTP PATCH requests to the specified path with the specified callback functions.

    Routes HTTP PATCH requests to the specified path with the specified callback functions. For more information, see the routing guide.

    Example:
    1. app.patch(path, callback [, callback ...])

  36. def post(path: String, callback: Function, callbacks: Function*): Router.this.type

    Permalink

    Routes HTTP POST requests to the specified path with the specified callback functions.

    Routes HTTP POST requests to the specified path with the specified callback functions. For more information, see the routing guide.

    You can provide multiple callback functions that behave just like middleware, except that these callbacks can invoke next('route') to bypass the remaining route callback(s). You can use this mechanism to impose pre-conditions on a route, then pass control to subsequent routes if there’s no reason to proceed with the current route.

    Example:
    1. app.post(path, callback [, callback ...])

  37. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  38. def propfind(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  39. def proppatch(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  40. def purge(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  41. def put(path: String, callback: Function, callbacks: Function*): Router.this.type

    Permalink

    Routes HTTP PUT requests to the specified path with the specified callback functions.

    Routes HTTP PUT requests to the specified path with the specified callback functions. For more information, see the routing guide.

    You can provide multiple callback functions that behave just like middleware, except that these callbacks can invoke next('route') to bypass the remaining route callback(s). You can use this mechanism to impose pre-conditions on a route, then pass control to subsequent routes if there’s no reason to proceed with the current route.

    Example:
    1. app.put(path, callback [, callback ...])

  42. def report(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  43. def search(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  44. def subscribe(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  46. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  47. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  48. def trace(path: String, callback: Function, callbacks: Function*): Router.this.type

    Permalink

    Routes HTTP TRACE requests to the specified path with the specified callback functions.

    Routes HTTP TRACE requests to the specified path with the specified callback functions. For more information, see the routing guide.

    Example:
    1. app.trace(path, callback [, callback ...])

  49. def unlock(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  50. def unsubscribe(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
  51. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  52. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped