Route

API ReferenceAppRoute

Source


Route.getTemplateView()

Static method of
Route
Parameters
  • viewName — String
Returns
Document

Source


constructor()

Parameters
  • options — Object

Access it with:

module.exports = function(app) {
    var Route = app.Route;
};

Acceptable syntaxes:

*Route* app.Route(*String* method, *String* uri, *Object* options)
*Route* app.Route(*String* methodWithUri, *Function* getData)
*Route* app.Route(*String* methodWithUri, *Object* options)
*Route* app.Route(*String* uri, *Function* getData)
*Route* app.Route(*String* uri, *Object* options)
*Route* app.Route(*String* method, *String* uri)
*Route* app.Route(*String* uri)
*Route* app.Route(*String* methodWithUri)

Source


method

Type
String
Default
'get'

uri

Type
Networking.Uri

app

Type
App

route

Type
App.Route

name

Type
String

schema

Type
Schema

data

Type
Any

error

Type
Any

factory()

Returns
Function

init()

Returns
Function

getData()

Parameters
  • callback — Functionoptional
Returns
Function

destroy()

Returns
Function

destroyJSON()

Returns
Function

destroyText()

Returns
Function

destroyHTML()

Returns
Function

redirect

Type
Networking.Uri

Can be also a function. May returns a Networking.Uri, any String or undefined.


request

Type
Networking.Request

response

Type
Networking.Response

next()

Returns
Function

Source


toJSON()

Returns
Any

Source


toText()

Returns
String

Source


toHTML()

Returns
Document

Source

results matching ""

    No results matching ""