Interface HttpServer<TRequest, TResponse>
Methods
createMiddlewareFactory
-
Parameters
Returns function
-
- (path: string, callback: Function): any
-
Parameters
-
path: string
-
callback: Function
Returns any
delete
-
Parameters
Returns any
-
Parameters
Returns any
get
-
Parameters
Returns any
-
Parameters
Returns any
Optional getRequestMethod
- getRequestMethod(request: TRequest): string
-
Parameters
Returns string
Optional getRequestUrl
- getRequestUrl(request: TResponse): string
-
Parameters
Returns string
head
-
Parameters
Returns any
-
Parameters
Returns any
listen
- listen(port: number | string, callback?: function): any
- listen(port: number | string, hostname: string, callback?: function): any
-
Parameters
-
port: number | string
-
Optional callback: function
Returns any
-
Parameters
-
port: number | string
-
hostname: string
-
Optional callback: function
Returns any
options
-
Parameters
Returns any
-
Parameters
Returns any
patch
-
Parameters
Returns any
-
Parameters
Returns any
post
-
Parameters
Returns any
-
Parameters
Returns any
put
-
Parameters
Returns any
-
Parameters
Returns any
registerParserMiddleware
- registerParserMiddleware(): any
render
- render(response: any, view: string, options: any): any
-
Parameters
-
response: any
-
view: string
-
options: any
Returns any
reply
- reply(response: any, body: any, statusCode?: number): any
-
Parameters
-
response: any
-
body: any
-
Optional statusCode: number
Returns any
Optional setBaseViewsDir
- setBaseViewsDir(path: string | string[]): this
Optional setErrorHandler
- setErrorHandler(handler: Function): any
setHeader
- setHeader(response: any, name: string, value: string): any
-
Parameters
-
response: any
-
name: string
-
value: string
Returns any
Optional setNotFoundHandler
- setNotFoundHandler(handler: Function): any
Optional setViewEngine
- setViewEngine(engineOrOptions: any): this
status
- status(response: any, statusCode: number): any
-
Parameters
-
response: any
-
statusCode: number
Returns any
use
-
Parameters
Returns any
-
Parameters
Returns any
Optional useStaticAssets
- useStaticAssets(...args: any[]): this