-
Notifications
You must be signed in to change notification settings - Fork 0
/
wrapper.js
102 lines (101 loc) · 3.03 KB
/
wrapper.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
'use strict';
module.exports = {
wrapServer: function(_restify, _registry) {
const server = {
get registry() {
// Post-initialize registry access.
return _registry;
},
get restify(){
return _restify;
},
get name(){
return _restify.name;
},
set name(value){
return _restify.name = value;
},
get url(){
return _restify.url;
},
set url(value){
return _restify.url = value;
},
get domain(){
return _restify.domain;
},
set domain(value){
return _restify.domain = value;
},
get log(){
return _restify.log;
},
set log(value){
return _restify.log = value;
},
get(...args) {
_restify.emit('transom.route.get', args);
return _restify.get(...args);
},
head(...args) {
_restify.emit('transom.route.head', args);
return _restify.head(...args);
},
post(...args) {
_restify.emit('transom.route.post', args);
return _restify.post(...args);
},
put(...args) {
_restify.emit('transom.route.put', args);
return _restify.put(...args);
},
patch(...args) {
_restify.emit('transom.route.patch', args);
return _restify.patch(...args);
},
del(...args) {
_restify.emit('transom.route.del', args);
return _restify.del(...args);
},
opts(...args) {
_restify.emit('transom.route.opts', args);
return _restify.opts(...args);
},
pre(...args) {
return _restify.pre(...args);
},
use(...args) {
return _restify.use(...args);
},
listen(...args) {
return _restify.listen(...args);
},
close(...args) {
return _restify.close(...args);
},
on(...args) {
return _restify.on(...args);
},
param(...args) {
return _restify.param(...args);
},
rm(...args) {
_restify.emit('transom.route.rm', args);
return _restify.rm(...args);
},
address() {
return _restify.address();
},
inflightRequests() {
return _restify.inflightRequests();
},
getDebugInfo() {
return _restify.getDebugInfo();
},
toString() {
return _restify.toString();
}
};
return server;
}
};