-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ts
104 lines (100 loc) · 2.82 KB
/
config.ts
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
import * as Confidence from 'confidence';
import * as Glue from '@hapi/glue';
const manifest /*: Glue.Manifest*/ = {
$meta: 'This file defines the microservice.',
server: {
port: { $param: 'port' },
debug: {
$filter: 'debug',
$default: { log: ['debug', 'error', 'uncaught'], request: ['debug', 'error', 'uncaught'] },
off: { log: false, request: false }
},
router: {
isCaseSensitive: false,
stripTrailingSlash: true
},
routes: {
cors: {
$filter: 'cors',
'on': {
origin: ['*']
},
'off': false
}
}
},
register: {
plugins: {
$filter: 'env',
$default: [
{ plugin: '@hapi/inert' },
{ plugin: '@hapi/vision' },
{ plugin: 'blipp' },
{
plugin: '@hapi/good',
options: {
ops: {
interval: 1000
},
reporters: {
console: [
{
module: '@hapi/good-squeeze',
name: 'Squeeze',
args: [
{
// log: '*',
error: '*',
response: '*'
// ops: '*'
}
]
},
{
module: '@hapi/good-console',
args: [
{
log: '*',
error: '*',
response: '*',
ops: '*'
}
]
},
'stdout'
]
}
}
},
{
plugin: 'hapi-swagger',
options: {
// title: 'Doare Payments API Documentation',
basePath: '/',
// version: Config.get('api.version')
info: {
title: 'Tractor Generated API Documentation',
description: 'This doc is given to you by Tractor.'
// version: Pack.version,
// termsOfService: 'https://github.com/glennjones/hapi-swagger/',
// contact: {
// email: '[email protected]'
// },
// license: {
// name: 'MIT',
// url:
// 'https://raw.githubusercontent.com/glennjones/hapi-swagger/master/license.txt'
// }
}
}
}
],
production: [
{ plugin: 'blipp' }
// production plugins here
]
}
}
};
export const Config = new Confidence.Store(manifest);
export default Config;