Class WebdaServer
Hierarchy
-
Core
- WebdaServer
Constructors
Properties
Methods
Constructors
-
Parameters
-
application: Application
Returns WebdaServer
-
Properties
JSON Schema validator instance
JSON Schema registry
Current executor
Init promise to ensure, webda is initiated Used for init() method
CORS Filter registry
Added via [[Webda.registerRequestFilter]] See [[CorsFilter]]
Type declaration
-
[key: string]: any
Methods
-
Return all methods that are setters (startsWith("set"))
Parameters
-
obj: any
service get setter from
Returns any[]
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Add a route dynamicaly
Parameters
-
url: string
of the route can contains dynamic part like {uuid}
-
info: RouteInfo
the type of executor
Returns void
-
-
Auto connect services with setters
Returns void
-
Verify if an origin is allowed to do request on the API
Parameters
-
ctx: Context
Returns Promise<boolean>
-
-
Parameters
-
event: string | symbol
-
Rest ...args: any[]
Returns boolean
-
-
Emit the event with data and wait for Promise to finish if listener returned a Promise
Parameters
-
event: any
-
Rest ...data: any[]
Returns Promise<any[]>
-
-
Returns Array<string | symbol>
-
Parameters
-
Optional skipHidden: boolean
Returns Document
-
-
Parameters
-
ctx: any
Returns void
-
-
Parameters
-
ctx: any
Returns void
-
-
Parameters
-
Optional subpath: string
Returns string
-
-
Return application definition
Returns Application
-
Initialize a ClientInfo structure based on request
Parameters
-
req: any
Returns ClientInfo
-
-
Returns Configuration
-
Retrieve all deployers
Returns object
-
[key: string]: ServiceConstructor<Service<ServiceParameters>>
-
-
Return the global parameters of a domain
Returns any
-
To define the locales just add a locales: ['en-GB', 'fr-FR'] in your host global configuration
Returns string[]
The configured locales or "en-GB" if none are defined
-
Get a Logger for a class
Parameters
-
clazz: string | Service
Returns Logger
-
-
Returns number
-
Check for a model name and return the wanted class or throw exception if none found
Parameters
-
name: any
The model name to retrieve
Returns any
-
-
Return a map of defined models
Returns object
-
[key: string]: CoreModelDefinition
-
-
Retrieve all detected modules definition
Returns CachedModule
-
Return current Router object
Returns Router
-
Return a salt to use when doing digest
Returns string
Current salt
-
This should return a "turning" secret with cache and a service to modify it every x mins WARNING The security is lower without this "turning" secret, you can still set the global.secret parameter
Dont rely on this method, it will probably disapear to avoid secret leak
Returns string
Current secret
-
Get server status
Returns ServerStatus
-
Check for a service name and return the wanted singleton or undefined if none found
Type parameters
-
T: Service
Parameters
-
Optional name: string
The service name to retrieve
Returns T
-
-
Parameters
-
service: string
Returns any
-
-
Return a map of defined services
Returns object
-
[key: string]: Service
-
-
Return a map of services that extends type
Parameters
-
Optional type: any
The type of implementation
Returns object
-
[key: string]: Service
-
-
Return a map of defined stores
Returns object
-
[key: string]: Service
-
-
Return webda current version
Returns string
package version
-
Get WorkerOutput
Returns WorkerOutput
-
Manage the request
Parameters
-
req: any
-
res: any
-
next: any
Returns Promise<any>
-
-
Parameters
-
req: any
-
res: any
-
next: any
Returns void
-
-
Init Webda
It will resolve Services init method and autolink
Returns Promise<void>
-
Init Routes declare by @Route annotation
Parameters
-
serviceBean: Service
Returns void
-
-
Returns void
-
Return if Webda is in debug mode
Returns boolean
-
Parameters
-
key: string
-
value: any
Returns any
-
-
Parameters
-
type: string | symbol
Returns number
-
-
Parameters
-
event: string | symbol
Returns Function[]
-
-
Logs
Parameters
-
level: WorkerLogLevel
-
Rest ...args: any[]
Returns void
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
Create a new context for a request
Type parameters
-
T: Context
Parameters
-
httpContext: HttpContext
THe HTTP request context
-
Optional stream: any
The request output stream if any
-
Optional noInit: boolean
Returns Promise<T>
A new context object to pass along
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
Retrieve a global parameter
Parameters
-
name: string
Returns any
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
Returns Function[]
-
-
Register model
Parameters
-
name: string
-
clazz: any
Returns void
-
-
Parameters
-
filter: RequestFilter<Context>
Returns void
-
-
Parameters
-
updates: any
Returns Promise<void>
-
-
Reinit the @Route
Returns void
-
Parameters
-
Optional event: string | symbol
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Remove a route dynamicly
Parameters
-
url: string
to remove
Returns void
-
-
Parameters
-
executor: any
The executor to expose as executor
-
code: any
to execute
Returns any
-
-
Start listening to serve request
Parameters
-
Default value port: number = 18080
to listen to
-
Default value websockets: boolean = false
to enable websockets
-
Default value bind: string = undefined
address to bind
Returns Promise<void>
-
-
Serve a static index if page not found, usefull for Single Page Application
Parameters
-
express: any
-
app: any
Returns void
-
-
Serve a static directory
Parameters
-
express: any
-
app: any
Returns void
-
-
Parameters
-
devMode: boolean
Returns void
-
-
Parameters
-
n: number
Returns this
-
-
Stop the http server
Returns Promise<void>
-
Convert an object to JSON using the Webda json filter
Parameters
-
object: any
The object to export
Returns string
The export of the strip object ( removed all attribute with _ )
-
-
Add to context information and executor based on the http context
Parameters
-
ctx: Context
Returns boolean
-
-
Validate the object with schema
Parameters
-
object: any
to validate
-
schema: any
path to use
Returns any
-
-
Get last errors from AJV schema validator ( called through validate method )
Returns any
-
Parameters
-
emitter: EventEmitter
-
event: string | symbol
Returns number
-
Generated using TypeDoc
{Object} config - The configuration Object, if undefined will load the configuration file