1 | /*
|
2 |
|
3 | ----------------------------------------------------------------------------
|
4 | | qewd-ripple: QEWD-based Middle Tier for Ripple OSI |
|
5 | | |
|
6 | | Copyright (c) 2016-17 Ripple Foundation Community Interest Company |
|
7 | | All rights reserved. |
|
8 | | |
|
9 | | http://rippleosi.org |
|
10 | | Email: code.custodian@rippleosi.org |
|
11 | | |
|
12 | | Author: Rob Tweed, M/Gateway Developments Ltd |
|
13 | | |
|
14 | | Licensed under the Apache License, Version 2.0 (the "License"); |
|
15 | | you may not use this file except in compliance with the License. |
|
16 | | You may obtain a copy of the License at |
|
17 | | |
|
18 | | http://www.apache.org/licenses/LICENSE-2.0 |
|
19 | | |
|
20 | | Unless required by applicable law or agreed to in writing, software |
|
21 | | distributed under the License is distributed on an "AS IS" BASIS, |
|
22 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
23 | | See the License for the specific language governing permissions and |
|
24 | | limitations under the License. |
|
25 | ----------------------------------------------------------------------------
|
26 |
|
27 | 12 October 2017
|
28 |
|
29 | */
|
30 |
|
31 | var ewdRipple = require('qewd-ripple/lib/startup');
|
32 |
|
33 | var config = {
|
34 | auth0: {
|
35 | domain: 'xxxxxxxxx.eu.auth0.com',
|
36 | clientID: 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
37 | callbackURL: 'http://xxx.xxx.xxx.xxx/auth0/token',
|
38 | clientSecret: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
39 | indexURL: '/index.html',
|
40 | connections: ['Username-Password-Authentication', 'google-oauth2', 'twitter']
|
41 | },
|
42 | port: 8081,
|
43 | poolSize: 2,
|
44 | ripple: {
|
45 | mode: 'secure'
|
46 | },
|
47 | bodyParser: require('body-parser'), // over-rides default setting for limit
|
48 | cors: true,
|
49 | ssl: false // SSL provided by nginx
|
50 | /*
|
51 | ssl: {
|
52 | keyFilePath: 'ssl/ssl.key',
|
53 | certFilePath: 'ssl/ssl.crt',
|
54 | }
|
55 | */
|
56 | };
|
57 |
|
58 | config.addMiddleware = function(bodyParser, app) {
|
59 |
|
60 | app.use(bodyParser.json({limit: '1mb'}));
|
61 | app.use(bodyParser.urlencoded({limit: '1mb', extended: true}));
|
62 |
|
63 | require('body-parser-xml')(bodyParser);
|
64 | app.use(bodyParser.xml({
|
65 | limit: '1MB',
|
66 | xmlParseOptions: {
|
67 | explicitArray: false
|
68 | }
|
69 | }));
|
70 | };
|
71 |
|
72 | ewdRipple.start(config);
|