all files / dist/config/servers/ web.js

100% Statements 7/7
83.33% Branches 5/6
100% Functions 2/2
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191                    18×                                                                                                                                                                                                                                                                                                                                                              
'use strict';
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
 
var _os = require('os');
 
var _os2 = _interopRequireDefault(_os);
 
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
exports.default = {
  servers: {
    web: function web(api) {
      return {
        // ---------------------------------------------------------------------
        // Enable server?
        // ---------------------------------------------------------------------
        enable: true,
 
        // ---------------------------------------------------------------------
        // HTTPS
        //
        // If this property are defined to false we will use a regular HTTP
        // connection, otherwise we use a secure HTTPS connection.
        // ---------------------------------------------------------------------
        secure: false,
 
        // ---------------------------------------------------------------------
        // This config map is passed to the https.createServer method.
        //
        // This is only used if we are using a secure connection. This should
        // contains the SSL certificate.
        // ---------------------------------------------------------------------
        serverOptions: {},
 
        // ---------------------------------------------------------------------
        // This is the IP who will be used to listen the web socket.
        //
        // If this property are defined to '0.0.0.0' we listen for all on the
        // IPv4 and IPv6.
        // ---------------------------------------------------------------------
        bindIP: '0.0.0.0',
 
        // ---------------------------------------------------------------------
        // Port ot Socket Path.
        //
        // This options can be overwrited withe PORT param on the console
        // execution.
        // ---------------------------------------------------------------------
        port: process.env.PORT || 8080,
 
        // ---------------------------------------------------------------------
        // This are the headers who are sended on all Stellar responses.
        //
        // By default this tells CORS to allow request from any origin.
        // ---------------------------------------------------------------------
        httpHeaders: {
          'X-Powered-By': api.config.general.serverName,
          'Access-Control-Allow-Origin': '*',
          'Access-Control-Allow-Methods': 'HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE',
          'Access-Control-Allow-Headers': 'Content-Type'
        },
 
        // ---------------------------------------------------------------------
        // Define the route that actions will be served from.
        //
        // Using a call format like REST is treated as an action call too.
        // IE: /api?action=generateNumber == /api/generateNumber
        // ---------------------------------------------------------------------
        urlPathForActions: 'api',
 
        // ---------------------------------------------------------------------
        // Route that static files will be served from.
        //
        // path relative to project root to server static content from, set to
        // `null` to disable the file server entirely.
        // ---------------------------------------------------------------------
        urlPathForFiles: 'public',
 
        // ---------------------------------------------------------------------
        // When visiting the root URL, should visitors see 'api' or 'file'?
        //
        // Visitors can always visit /api and /public as normal.
        // ---------------------------------------------------------------------
        rootEndpointType: 'file',
 
        // ---------------------------------------------------------------------
        // Simple routing also adds an 'all' route which matches /api/:action
        // for all actions.
        // ---------------------------------------------------------------------
        simpleRouting: true,
 
        // ---------------------------------------------------------------------
        // Query Routing allows an action to be defined via a URL param.
        //
        // ex: /api?action=:action
        // ---------------------------------------------------------------------
        queryRouting: true,
 
        // ---------------------------------------------------------------------
        // Header which will be returned for all flat file (defined in seconds)
        // ---------------------------------------------------------------------
        flatFileCacheDuration: 60,
 
        // ---------------------------------------------------------------------
        // This define the many times the Stellar should try boot the server.
        //
        // This might happen if the port is in use by another process or the
        // socketfile is claimed.
        // ---------------------------------------------------------------------
        bootAttempts: 1,
 
        // ---------------------------------------------------------------------
        // Settings for determining the id of an http(s) request
        // (browser-fingerprint)
        // ---------------------------------------------------------------------
        fingerprintOptions: {
          cookieKey: 'sessionID',
          toSetCookie: true,
          onlyStaticElements: false,
          settings: {
            path: '/',
            expires: 3600000
          }
        },
 
        // ---------------------------------------------------------------------
        // Options to be applied to incoming file uploads.
        // ---------------------------------------------------------------------
        formOptions: {
          uploadDir: _os2.default.tmpdir(),
          keepExtensions: false,
          maxFieldsSize: 1024 * 1024 * 100
        },
 
        // ---------------------------------------------------------------------
        // Enable JSON padding to make more human-readable.
        //
        // Set to null to disable.
        // ---------------------------------------------------------------------
        padding: 2,
 
        // ---------------------------------------------------------------------
        // Options to configure metadata in responses
        // ---------------------------------------------------------------------
        metadataOptions: {
          serverInformation: true,
          requesterInformation: true
        },
 
        // ---------------------------------------------------------------------
        // When true, will modify the response header if connection.error is not
        // null.
        //
        // Is also possible set connection.rawConnection.responseHttpCode to
        // specify a code per request.
        // ---------------------------------------------------------------------
        returnErrorCodes: true,
 
        // ---------------------------------------------------------------------
        // Use GZIP (compression) on the server responses.
        //
        // This only works when the client accept them. This also will slow down
        // the performance of Stellar, and if you need this feature, it is
        // recommended that you do this upstream with nginx or on a load
        // balancer.
        // ---------------------------------------------------------------------
        compress: false,
 
        // ---------------------------------------------------------------------
        // Options to pass to the query parser.
        //
        // All options available at https://github.com/hapijs/qs
        // ---------------------------------------------------------------------
        queryParseOptions: {},
 
        // ---------------------------------------------------------------------
        // ETAG Header
        //
        // When true, an ETAG Header will be provided with each requested static
        // file for caching reasons.
        // ---------------------------------------------------------------------
        enableEtag: true
      };
    }
  }
};
//# sourceMappingURL=web.js.map