Spaces:
Running
Running
Update server.js
Browse files
server.js
CHANGED
@@ -13,9 +13,12 @@ app.use('/', proxy(targetUrl, {
|
|
13 |
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
|
14 |
// Modify the request headers if necessary
|
15 |
proxyReqOpts.headers['Authorization'] = 'Bearer ' + openai_key;
|
|
|
16 |
return proxyReqOpts;
|
17 |
},
|
18 |
userResDecorator: (proxyRes, proxyResData, userReq, userRes) => {
|
|
|
|
|
19 |
return proxyResData;
|
20 |
},
|
21 |
proxyErrorHandler: (err, res, next) => {
|
|
|
13 |
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
|
14 |
// Modify the request headers if necessary
|
15 |
proxyReqOpts.headers['Authorization'] = 'Bearer ' + openai_key;
|
16 |
+
console.log('Proxy request options:', proxyReqOpts);
|
17 |
return proxyReqOpts;
|
18 |
},
|
19 |
userResDecorator: (proxyRes, proxyResData, userReq, userRes) => {
|
20 |
+
console.log('Proxy response status:', proxyRes.statusCode);
|
21 |
+
console.log('Proxy response data:', proxyResData.toString('utf8'));
|
22 |
return proxyResData;
|
23 |
},
|
24 |
proxyErrorHandler: (err, res, next) => {
|