Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Application

Hierarchy

Callable

Index

Properties

_params

_params: any[]

_router

_router: Router

Used to get all registered routes in Opine Application

all

all: IRouterMatcher<this, "all">

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

cache

cache: any

caseSensitive

caseSensitive: boolean

checkout

checkout: IRouterMatcher<this>

connect

connect: IRouterMatcher<this>

copy

copy: IRouterMatcher<this>

delete

delete: IRouterMatcher<this, "delete">

engines

engines: any

get

get: (setting: string) => any & IRouterMatcher<this>

head

head: IRouterMatcher<this, "head">

locals

locals: any

lock

lock: IRouterMatcher<this>

m-search

m-search: IRouterMatcher<this>

merge

merge: IRouterMatcher<this>

mergeParams

mergeParams: boolean

mkactivity

mkactivity: IRouterMatcher<this>

mkcol

mkcol: IRouterMatcher<this>

mountpath

mountpath: string | string[]

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

move

move: IRouterMatcher<this>

notify

notify: IRouterMatcher<this>

options

options: IRouterMatcher<this, "options">

params

params: any

parent

parent: any

patch

patch: IRouterMatcher<this, "patch">

post

post: IRouterMatcher<this, "post">

propfind

propfind: IRouterMatcher<this>

proppatch

proppatch: IRouterMatcher<this>

purge

purge: IRouterMatcher<this>

put

put: IRouterMatcher<this, "put">

report

report: IRouterMatcher<this>

router

router: string

routes

routes: any

The app.routes object houses all of the routes defined mapped by the associated HTTP verb. This object may be used for introspection capabilities, for example Opine uses this internally not only for routing but to provide default OPTIONS behaviour unless app.options() is used. Your application or framework may also remove routes by simply by removing them from this object.

search

search: IRouterMatcher<this>

settings

settings: any

stack

stack: any[]

Stack of configured routes

strict

strict: boolean

subscribe

subscribe: IRouterMatcher<this>

trace

trace: IRouterMatcher<this>

unlock

unlock: IRouterMatcher<this>

unsubscribe

unsubscribe: IRouterMatcher<this>

use

Methods

defaultConfiguration

  • defaultConfiguration(): void

disable

  • disable(setting: string): this

disabled

  • disabled(setting: string): boolean

emit

  • emit(event: string, arg: any): any
  • Emit an event using the applications event emitter.

    Events will be raised based on the passed event string and any listening on() methods will receive the passed arg as an argument.

    Parameters

    • event: string
    • arg: any

    Returns any

enable

  • enable(setting: string): this

enabled

  • enabled(setting: string): boolean

engine

  • engine(ext: string, fn: (path: string, options: Record<string, unknown>, callback: (e: any, rendered: string) => void) => void): this
  • Register the given template engine callback fn for the provided extension ext.

    Parameters

    • ext: string
    • fn: (path: string, options: Record<string, unknown>, callback: (e: any, rendered: string) => void) => void
        • (path: string, options: Record<string, unknown>, callback: (e: any, rendered: string) => void): void
        • Parameters

          • path: string
          • options: Record<string, unknown>
          • callback: (e: any, rendered: string) => void
              • (e: any, rendered: string): void
              • Parameters

                • e: any
                • rendered: string

                Returns void

          Returns void

    Returns this

Private handle

init

  • init(): void

lazyrouter

  • lazyrouter(): void
  • Lazily adds the base router if it has not yet been added.

    We cannot add the base router in the defaultConfiguration because it reads app settings which might be set after that has run.

    Returns void

listen

  • listen(): Server
  • listen(port: number, callback?: () => void): Server
  • listen(addr: string, callback?: () => void): Server
  • listen(options: HTTPOptions, callback?: () => void): Server
  • listen(options: HTTPSOptions, callback?: () => void): Server

on

  • on(event: string, callback: (args: any) => any): any
  • The mount event is fired on a sub-app, when it is mounted on a parent app. The parent app is passed to the callback function.

    NOTE: Sub-apps will:

    • Not inherit the value of settings that have a default value. You must set the value in the sub-app.
    • Inherit the value of settings with no default value.

    Parameters

    • event: string
    • callback: (args: any) => any
        • (args: any): any
        • Parameters

          • args: any

          Returns any

    Returns any

param

path

  • path(): string
  • Return the app's absolute pathname based on the parent(s) that have mounted it.

    For example if the application was mounted as "/admin", which itself was mounted as "/blog" then the return value would be "/blog/admin".

    Returns string

Private process_params

render

  • render(name: string, options?: any, callback?: (err: Error, html: string) => void): void
  • render(name: string, callback: (err: Error, html: string) => void): void
  • Render the given view name name with options and a callback accepting an error and the rendered template string.

    Example:

    app.render('email', { name: 'Deno' }, function(err, html) { // ... })

    Parameters

    • name: string
    • Optional options: any
    • Optional callback: (err: Error, html: string) => void
        • (err: Error, html: string): void
        • Parameters

          • err: Error
          • html: string

          Returns void

    Returns void

  • Parameters

    • name: string
    • callback: (err: Error, html: string) => void
        • (err: Error, html: string): void
        • Parameters

          • err: Error
          • html: string

          Returns void

    Returns void

route

set

  • set(setting: string, value?: any): this
  • Assign setting to val, or return setting's value.

    app.set('foo', 'bar'); app.get('foo'); // => "bar"

    Mounted servers inherit their parent server's settings.

    Parameters

    • setting: string
    • Optional value: any

    Returns this

Generated using TypeDoc