Trait/Object

io.scalajs.npm.express

Application

Related Docs: object Application | package express

Permalink

trait Application extends Object with IEventEmitter with Router

The app object conventionally denotes the Express application. Create it by calling the top-level express() function exported by the Express module.

Annotations
@RawJSType() @native()
See also

http://expressjs.com/en/api.html

Linear Supertypes
Router, IEventEmitter, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Application
  2. Router
  3. IEventEmitter
  4. Object
  5. Any
  6. AnyRef
  7. 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 addListener(eventName: String, listener: Function): Application.this.type

    Permalink
    Definition Classes
    IEventEmitter
  5. def all(path: String, callback: Function, callbacks: Function*): Application.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

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

  6. final def asInstanceOf[T0]: T0

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

    Permalink
    Definition Classes
    Router
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def connect(path: String, callback: Function, callbacks: Function*): Application.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.

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

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

    Permalink
    Definition Classes
    Router
  11. def delete(path: String, callback: Function, callbacks: Function*): Application.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.

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

  12. def disable(name: String): Unit

    Permalink

    Sets the Boolean setting name to false, where name is one of the properties from the app settings table.

    Sets the Boolean setting name to false, where name is one of the properties from the app settings table. Calling app.set('foo', false) for a Boolean property is the same as calling app.disable('foo').

    Example:
    1. app.disable(name)

  13. def disabled(name: String): Boolean

    Permalink

    Returns true if the Boolean setting name is disabled (false), where name is one of the properties from the app settings table.

    Returns true if the Boolean setting name is disabled (false), where name is one of the properties from the app settings table.

    Example:
    1. app.disabled(name)

  14. var domain: String

    Permalink
    Definition Classes
    IEventEmitter
  15. def emit(name: String, args: Any*): Any

    Permalink
    Definition Classes
    IEventEmitter
  16. def enable(name: String): Unit

    Permalink

    Sets the Boolean setting name to true, where name is one of the properties from the app settings table.

    Sets the Boolean setting name to true, where name is one of the properties from the app settings table. Calling app.set('foo', true) for a Boolean property is the same as calling app.enable('foo').

    Example:
    1. app.enable(name)

  17. def enabled(name: String): Boolean

    Permalink

    Returns true if the setting name is enabled (true), where name is one of the properties from the app settings table.

    Returns true if the setting name is enabled (true), where name is one of the properties from the app settings table.

    Example:
    1. app.enabled(name)

  18. def engine(name: String, callback: Function): Unit

    Permalink

    Registers the given template engine callback as ext.

    Registers the given template engine callback as ext. By default, Express will require() the engine based on the file extension. For example, if you try to render a “foo.jade” file, Express invokes the following internally, and caches the require() on subsequent calls to increase performance.

    Example:
    1. app.engine(ext, callback)

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def get(name: String): UndefOr[String]

    Permalink

    Returns the value of name app setting, where name is one of strings in the app settings table.

    Returns the value of name app setting, where name is one of strings in the app settings table.

    Example:
    1. app.get(name)

  23. def get(path: String, callback: Function, callbacks: Function*): Application.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.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  25. def getMaxListeners(): Int

    Permalink
    Definition Classes
    IEventEmitter
  26. def hasOwnProperty(v: String): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  28. def head(path: String, callback: Function, callbacks: Function*): Application.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.

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

  29. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    Object
  31. def listen(port: |[Int, String]): Server

    Permalink

    Binds and listens for connections on the specified host and port.

    Binds and listens for connections on the specified host and port. This method is identical to Node’s http.Server.listen().

  32. def listen(port: |[Int, String], callback: Function): Server

    Permalink

    Binds and listens for connections on the specified host and port.

    Binds and listens for connections on the specified host and port. This method is identical to Node’s http.Server.listen().

  33. def listen(port: |[Int, String], hostname: String): Server

    Permalink

    Binds and listens for connections on the specified host and port.

    Binds and listens for connections on the specified host and port. This method is identical to Node’s http.Server.listen().

  34. def listen(port: |[Int, String], hostname: String, callback: Function): Server

    Permalink

    Binds and listens for connections on the specified host and port.

    Binds and listens for connections on the specified host and port. This method is identical to Node’s http.Server.listen().

  35. def listen(port: |[Int, String], hostname: String, backlog: Int): Server

    Permalink

    Binds and listens for connections on the specified host and port.

    Binds and listens for connections on the specified host and port. This method is identical to Node’s http.Server.listen().

  36. def listen(port: |[Int, String], hostname: String, backlog: Int, callback: Function): Server

    Permalink

    Binds and listens for connections on the specified host and port.

    Binds and listens for connections on the specified host and port. This method is identical to Node’s http.Server.listen().

    Example:
    1. app.listen(port, [hostname], [backlog], [callback])

  37. def listenerCount(eventName: String): Int

    Permalink
    Definition Classes
    IEventEmitter
  38. def listeners(eventName: String): Array[Function]

    Permalink
    Definition Classes
    IEventEmitter
  39. var locals: Any

    Permalink

    The app.locals object has properties that are local variables within the application.

    The app.locals object has properties that are local variables within the application.

    See also

    http://expressjs.com/en/api.html#app.locals

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

    Permalink
    Definition Classes
    Router
  41. def m_search(path: String, callback: Function, callbacks: Function*): Unit

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

    Permalink
    Definition Classes
    Router
  43. def mkactivity(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
    Definition Classes
    Router
  44. def mkcol(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
    Definition Classes
    Router
  45. var mountpath: Any

    Permalink

    The app.mountpath property contains one or more path patterns on which a sub-app was mounted.

    The app.mountpath property contains one or more path patterns on which a sub-app was mounted.

    See also

    http://expressjs.com/en/api.html#app.mountpath

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

    Permalink
    Definition Classes
    Router
  47. final def ne(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    Router
  49. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  51. def on(eventName: String, listener: Function): Application.this.type

    Permalink
    Definition Classes
    IEventEmitter
  52. def once(eventName: String, listener: Function): Application.this.type

    Permalink
    Definition Classes
    IEventEmitter
  53. def options(path: String, callback: Function, callbacks: Function*): Application.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.

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

  54. def param(callback: Function): Unit

    Permalink
    Definition Classes
    Router
  55. def param(names: Array[String], callback: Function): Unit

    Permalink
    Definition Classes
    Router
  56. 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.

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

  57. def patch(path: String, callback: Function, callbacks: Function*): Application.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.

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

  58. def path(): String

    Permalink

    Returns the canonical path of the app, a string.

    Returns the canonical path of the app, a string.

    Example:
    1. app.path()

  59. def post(path: String, callback: Function, callbacks: Function*): Application.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.

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

  60. def propertyIsEnumerable(v: String): Boolean

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

    Permalink
    Definition Classes
    Router
  62. def proppatch(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
    Definition Classes
    Router
  63. def purge(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
    Definition Classes
    Router
  64. def put(path: String, callback: Function, callbacks: Function*): Application.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.

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

  65. def removeAllListeners(): Application.this.type

    Permalink
    Definition Classes
    IEventEmitter
  66. def removeAllListeners(eventName: String): Application.this.type

    Permalink
    Definition Classes
    IEventEmitter
  67. def removeListener(eventName: String, listener: Function): Application.this.type

    Permalink
    Definition Classes
    IEventEmitter
  68. def render(view: String, locals: Any, callback: Function): Unit

    Permalink

    Returns the rendered HTML of a view via the callback function.

    Returns the rendered HTML of a view via the callback function. It accepts an optional parameter that is an object containing local variables for the view. It is like res.render(), except it cannot send the rendered view to the client on its own.

    Example:
    1. app.render(view, [locals], callback)

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

    Permalink
    Definition Classes
    Router
  70. def route(path: String): Any

    Permalink

    Returns an instance of a single route, which you can then use to handle HTTP verbs with optional middleware.

    Returns an instance of a single route, which you can then use to handle HTTP verbs with optional middleware. Use app.route() to avoid duplicate route names (and thus typo errors).

    Example:
    1. app.route(path)

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

    Permalink
    Definition Classes
    Router
  72. def set(headers: Any): Application.this.type

    Permalink
  73. def set(name: String, value: Any): Application.this.type

    Permalink

    Assigns setting name to value, where name is one of the properties from the app settings table.

    Assigns setting name to value, where name is one of the properties from the app settings table. Calling app.set('foo', true) for a Boolean property is the same as calling app.enable('foo'). Similarly, calling app.set('foo', false) for a Boolean property is the same as calling app.disable('foo'). Retrieve the value of a setting with app.get().

    Example:
    1. app.set(name, value)

  74. def setMaxListeners(n: Int): Application.this.type

    Permalink
    Definition Classes
    IEventEmitter
  75. def subscribe(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
    Definition Classes
    Router
  76. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  79. def trace(path: String, callback: Function, callbacks: Function*): Application.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.

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

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

    Permalink
    Definition Classes
    Router
  81. def unsubscribe(path: String, callback: Function, callbacks: Function*): Unit

    Permalink
    Definition Classes
    Router
  82. def use(router: |[Router, Any]): Application.this.type

    Permalink

    Mounts the specified middleware function or functions at the specified path.

    Mounts the specified middleware function or functions at the specified path. If path is not specified, it defaults to “/”.

    Example:
    1. app.use([path,] function [, function...])

  83. def use(callback: Function, next: Function*): Application.this.type

    Permalink

    Mounts the specified middleware function or functions at the specified path.

    Mounts the specified middleware function or functions at the specified path. If path is not specified, it defaults to “/”.

    Example:
    1. app.use([path,] function [, function...])

  84. def use(path: String, callback: Function, next: Function*): Application.this.type

    Permalink

    Mounts the specified middleware function or functions at the specified path.

    Mounts the specified middleware function or functions at the specified path. If path is not specified, it defaults to “/”.

    Example:
    1. app.use([path,] function [, function...])

  85. def use(path: String, router: |[Router, Any]): Application.this.type

    Permalink

    Mounts the specified middleware function or functions at the specified path.

    Mounts the specified middleware function or functions at the specified path. If path is not specified, it defaults to “/”.

    Example:
    1. app.use([path,] function [, function...])

  86. var usingDomains: Boolean

    Permalink
    Definition Classes
    IEventEmitter
  87. def valueOf(): Any

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

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

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

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

Deprecated Value Members

  1. def configure(init: Function): Unit

    Permalink

    app.configure has been removed in Express 4.x.

    app.configure has been removed in Express 4.x.

    Annotations
    @deprecated
    Deprecated

    (Since version 4.x) app.configure has been removed

    Example:
    1. app.configure(init)

Inherited from Router

Inherited from IEventEmitter

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped