-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathconfig.js
83 lines (78 loc) · 2.38 KB
/
config.js
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
/**
* Web server port
*/
const SERVER_PORT = 3005;
/**
* Session settings
*/
const SESSION_SECRET = 'Z>lFs46=B)$u(742x5(iEH6k&m';
/**
* MongoDB configuration settings
*
* Note:
* - If you use cloud service like mongodb.com/cloud, you need to change to CONNECTION_TYPE to 'mongodb+srv'!
* - DB_QUERY_PARAMS is optional, but if you use cloud service like mongodb.com/cloud,
* then the following query params is recommend: '?retryWrites=true&w=majority'
*/
const CONNECTION_TYPE = "mongodb";
const DB_USERNAME = "";
const DB_PASSWORD = "";
const DB_HOST = "localhost";
const DB_PORT = "27017";
const DB_NAME = "express-boilerplate";
const DB_QUERY_PARAMS = "";
/**
* SSL / HTTPS settings
* ------------------------
* if HTTPS is true, the PRIVATE_KEY_PATH, CERTIFICATE_PATH and CA_PATH MUST be correctly located.
*
* PRIVATE_KEY_PATH is the path where the privkey.pem file is located
* CERTIFICATE_PATH is the path where the cert.pem file is located
* CA_PATH is the path where the chain.pem file is located
*/
const HTTPS_ENABLED = false;
const PRIVATE_KEY_PATH = '/opt/psa/var/modules/letsencrypt/etc/live/YOUR-DOMAIN-NAME.com/privkey.pem';
const CERTIFICATE_PATH = '/opt/psa/var/modules/letsencrypt/etc/live/YOUR-DOMAIN-NAME.com/cert.pem';
const CA_PATH = '/opt/psa/var/modules/letsencrypt/etc/live/YOUR-DOMAIN-NAME.com/chain.pem';
/**
* Swagger UI settings
* ------------------------
* Swagger UI is a collection of HTML, Javascript, and CSS assets
* that dynamically generate beautiful documentation from a Swagger-compliant API.
*
* You can visit the Swagger API documentation on /api-docs
* Example: http://localhost:3005/api-docs/
*/
const SWAGGER_SETTINGS = {
enableSwaggerUI: true,
swaggerDefinition: {
info: {
title: 'Express.js & Socket.io server',
description: 'Express.js endpoint API documentation.',
version: '1.0.0',
},
basePath: '/',
produces: [
"application/json"
],
schemes: ['http', 'https'],
},
basedir: __dirname, //app absolute path
files: ['./routes/**/*.js'] //Path to the API handle folder
};
module.exports = {
SERVER_PORT,
SESSION_SECRET,
CONNECTION_TYPE,
DB_USERNAME,
DB_PASSWORD,
DB_HOST,
DB_PORT,
DB_NAME,
DB_QUERY_PARAMS,
HTTPS_ENABLED,
PRIVATE_KEY_PATH,
CERTIFICATE_PATH,
CA_PATH,
SWAGGER_SETTINGS
};