Methods
(static) framework(argsopt, config, logger)
Creates an express server and passes `app` and `logger` to karma
configuration for further extension.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
args |
Array |
<optional> |
[] | args not currently used |
config |
karmaExpressServer.Config | |||
logger |
Karma.Plugin.Logger | Official Docs |
Type Definitions
callback(httpServer)
Called when server is ready to serve traffic.
Parameters:
Name | Type | Description |
---|---|---|
httpServer |
http.Server | Official Docs |
Config
Configuration options for karmaExpressServer framework.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
callback |
karmaExpressServer.callback | |||
accessControlAllowOrigin |
string |
<optional> |
'http://localhost:9876' | |
accessControlAllowCredentials |
string |
<optional> |
'true' | |
accessControlAllowMethods |
string |
<optional> |
'GET, PUT, POST, DELETE, OPTIONS' | |
accessControlMaxAge |
string |
<optional> |
'3600' | |
accessControlAllowHeaders |
string |
<optional> |
'x-requested-with, Content-Type, Content-Length, Content-Range, Content-Encoding' | |
protocol |
string |
<optional> |
'http' | |
httpsServerOptions |
https.createServer.options |
<optional> |
Official Docs | |
serverPort |
number |
<optional> |
9877 | |
extensions |
Array.<karmaExpressServer.Extension> |
<optional> |
[] |
Extension
Provides a hook into express server api's for extension.
Properties:
Name | Type | Description |
---|---|---|
app |
Express.Application | Official Docs |
logger |
Karma.Plugin.Logger | Official Docs |