@@ -32,13 +32,13 @@ const options = {
32
32
33
33
// additional request headers
34
34
headers: {
35
- ' x-powered-by' : ' foobar'
35
+ ' x-powered-by' : ' foobar' ,
36
36
},
37
37
38
38
// rewrite paths
39
39
pathRewrite: {
40
40
' ^/api/old-path' : ' /api/new-path' , // rewrite path
41
- ' ^/api/remove/path' : ' /path' // remove base path
41
+ ' ^/api/remove/path' : ' /path' , // remove base path
42
42
},
43
43
44
44
// re-target based on the request's host header and/or path
@@ -48,15 +48,15 @@ const options = {
48
48
' integration.localhost:8000' : ' http://localhost:8001' , // host only
49
49
' staging.localhost:8000' : ' http://localhost:8002' , // host only
50
50
' localhost:8000/api' : ' http://localhost:8003' , // host + path
51
- ' /rest' : ' http://localhost:8004' // path only
51
+ ' /rest' : ' http://localhost:8004' , // path only
52
52
},
53
53
54
54
// control logging
55
55
logLevel: ' silent' ,
56
56
57
57
// use a different lib for logging;
58
58
// i.e., write logs to file or server
59
- logProvider : function (provider ) {
59
+ logProvider : function (provider ) {
60
60
return winston;
61
61
},
62
62
@@ -67,16 +67,16 @@ const options = {
67
67
},
68
68
69
69
// subscribe to http-proxy's proxyRes event
70
- onProxyRes : function (proxyRes , req , res ) {
70
+ onProxyRes : function (proxyRes , req , res ) {
71
71
proxyRes .headers [' x-added' ] = ' foobar' ;
72
72
delete proxyRes .headers [' x-removed' ];
73
73
},
74
74
75
75
// subscribe to http-proxy's proxyReq event
76
- onProxyReq : function (proxyReq , req , res ) {
76
+ onProxyReq : function (proxyReq , req , res ) {
77
77
// add custom header to request
78
78
proxyReq .setHeader (' x-powered-by' , ' foobar' );
79
- }
79
+ },
80
80
81
81
/**
82
82
* The following options are provided by Nodejitsu's http-proxy
0 commit comments