Rooni commited on
Commit
6997b8b
1 Parent(s): 4fa4127

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +3 -0
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) => {