UNPKG

1.95 kBJavaScriptView Raw
1
2const schemaProperties = {
3 hostname: { type: 'string' },
4 httpPort: { type: 'number' },
5 httpsPort: { type: 'number' },
6 appPath: {
7 type: 'string',
8 description: 'optionally set application path, if you run application on http://appdomain.com/reporting then set "/reporting" to `appPath`. The default behavior is that it is assumed that jsreport is running behind a proxy, so you need to do url url rewrite /reporting -> / to make it work correctly, See `mountOnAppPath` when there is no proxy + url rewrite involved in your setup.'
9 },
10 mountOnAppPath: {
11 type: 'boolean',
12 default: false,
13 description: 'use this option along with `appPath`. it specifies if all jsreport routes should be available with appPath as prefix, therefore making `appPath` the new root url of application'
14 },
15 certificate: {
16 type: 'object',
17 properties: {
18 key: { type: 'string' },
19 cert: { type: 'string' }
20 }
21 }
22}
23
24module.exports = {
25 'name': 'express',
26 'main': 'lib/reporter.express.js',
27 'optionsSchema': {
28 ...schemaProperties,
29 extensions: {
30 express: {
31 type: 'object',
32 properties: {
33 ...schemaProperties,
34 start: {
35 type: 'boolean',
36 default: true,
37 description: 'specifies if the server should be started automatically during jsreport initialization, if false you should start the server manually by using jsreport.express.start() after jsreport is initialized'
38 },
39 trustProxy: { type: 'boolean', default: true },
40 inputRequestLimit: { type: 'string', default: '20mb' },
41 exposeHttpHeaders: {
42 type: 'boolean',
43 default: false,
44 description: 'specifies if incoming request http headers should be exposed as `req.context.http.headers` inside jsreport scripts'
45 },
46 renderTimeout: { type: 'number', default: 1200000 }
47 }
48 }
49 }
50 }
51}