The ESD/SPD Web Editor relies on the ESD/SPD Web server. This server provides web services for:
The configuration file for server is located at <install location>\server\config\config.json. This file contains settings that control the behavior of the server.
The settings in the server configuration file include:
Setting | Type | Default | Description |
hostname | String | 0.0.0.0 | The interface(s) the server will to listen on. This must be either a host name that resolves to the address of an interface on the host, the address of an interface on the host, or the value "0.0.0.0" which will cause the server to listen on all interfaces on the host machine. |
port | Integer | 3000 or 443 | The port the server will listen on. The default port is 443 if the ssl setting is provided. |
compression | Boolean | true | If set to true, the web server will compress outbound content. |
samples | Boolean | true | If set to true, the editor sample pages will be enabled. |
documentation | Boolean | true | If set to true, the SDK documentation page will be enabled. |
drawService | Boolean | true | If set to true, the web service will be enabled. |
maxLogSize | Integer | 5000000 (5 MB) |
The maximum size of a log in characters. When this threshold is reached, the log will be closed and archived. |
maxLogCount | Integer | 30 | The maximum number of log files to keep. This includes the current log file and any archived log files. When this threshold is reached, the oldest archived log files will be discarded. |
logDir | String | logs | The directory where the log files will be created. This can be a relative or absolute path. If a relative path is specified, the log directory will be relative to <Web SDK install location>\server. The log directory will be created if it does not exist. |
cacheTimeout | Integer > 0 or String | 1000 | Specifies a max-age in milliseconds for http caching of static content. This can also be a string accepted by the nodejs ms module. |
sampleRESTServiceUrl | String | /REST | The root URL of the REST services for the samples. |
proxyWhiteList | String Array | A list of allowed target domain names for proxying map images and data.
If not defined, the map proxy will be disabled. Valid values will have the form: [ "valid.domain.com", "other.valid.domain.com", ...] |
|
valid-origins | String Array (request origins) or String (regular expression) | Controls cross origin access to the web service. This is either a list of valid
request origins or a regular expression that request origins must match
to be considered. Valid values will have the form: [ "valid origin 1", "valid origin 2", ...] or "<regular expression>" |
|
ssl | Object | Defines the server's SSL configuration. Valid values will have the form: { key: "<key file path>", cert: "<cert file path>" } |
|
rasterizeLifetimeRequests | Integer > 0 | 75 | The target maximum number of requests handled by an instance of the rasterizer service. When this number is exceeded the rasterizer instance will be retired and a new instance started. |
rasterizeLifetimeSeconds | Integer > 0 | 3600 | The target lifetime of a rasterizer service instance in seconds. When a rasterizer's lifetime exceeds this value it will be retired and a new instance started. |
rasterizeMaxActiveRequests | Integer > 0 | 3 | The maximum number of concurrent rasterize requests. |
rasterizeMaxRequestDelay | Integer > 0 | 5000 | The target maximum execution time in milliseconds for rasterize requests. When the server is busy and is unlikely to meet this goal, it will reject rasterize requests. |
rasterizeMaxWidthHeight | Integer 0 < value <= 10,000 |
4000 | The maximum width/height for rasterize requests in pixels. |
rasterizeRenderTasks | Integer >= 2 | 2 | The number of processes in the rasterizer task pool. Increasing this value may improve rasterization performance when there are many simultaneous requests. |
rasterizeTcpPortRange | Numeric Array | [2011, 2032] | A 2 element array defining the range of TCP ports available for use by the rasterizer. The range must encompass at least 4 port numbers. |
rasterizeTimeout | Integer > 0 | 15000 | Timeout for rasterize requests in milliseconds. |
rasterizeDefaultWidth | Integer 0 < value <= rasterizeMaxWidthHeight |
1200 | The default width for rasterize requests in pixels. |
rasterizeDefaultHeight | Integer 0 < value <= rasterizeMaxWidthHeight |
1200 | The default height for rasterize requests in pixels. |
rasterizeDefaultMargin | Integer 0 < value <= 1/2 of max( rasterizeDefaultWidth, rasterizeDefaultHeight) |
10 | The default margin for rasterize requests in pixels. |
rasterizeDefaultImageQuality | Number 0 < value <= 1.0 |
0.75 | The default JPEG image quality for rasterize requests. |
rasterizeDefaultFormat | String 'image/png' or 'image/jpeg' |
'image/png' | The default image format for rasterize requests. |
rasterizeVerboseLog | Boolean | false | Include more verbose content in the rasterizer log? |
tempFileAutoDelete | Boolean | true | If true, temp files will be automatically deleted. |
SSL: The standard web server functionality of Node.js is used in the server. There are many optional features and settings available which can be referenced in the Node.js documentation here.
Operation Behind a Reverse Proxy: The web service does not keep state and generally does not require special treatment.
Load Balancing: To assist with load balancing, a status end-point is provided at /status which always returns a 200 status code and the text "OK" when the server is running.