Spaces:
Paused
Paused
Update server.js
Browse files
server.js
CHANGED
|
@@ -63,6 +63,9 @@ app.use('/api', authenticateProxyKeyAndModel, (req, res, next) => {
|
|
| 63 |
const modifiedBody = JSON.stringify(srcReq.body);
|
| 64 |
proxyReqOpts.headers['Content-Length'] = Buffer.byteLength(modifiedBody);
|
| 65 |
proxyReqOpts.body = modifiedBody;
|
|
|
|
|
|
|
|
|
|
| 66 |
}
|
| 67 |
|
| 68 |
return proxyReqOpts;
|
|
@@ -71,9 +74,6 @@ app.use('/api', authenticateProxyKeyAndModel, (req, res, next) => {
|
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
app.get("/", (req, res) => {
|
| 78 |
// res.send(This is your OpenAI Reverse Proxy URL: ${baseUrl});
|
| 79 |
});
|
|
|
|
| 63 |
const modifiedBody = JSON.stringify(srcReq.body);
|
| 64 |
proxyReqOpts.headers['Content-Length'] = Buffer.byteLength(modifiedBody);
|
| 65 |
proxyReqOpts.body = modifiedBody;
|
| 66 |
+
|
| 67 |
+
// Log the body being sent to the API
|
| 68 |
+
console.log('Body being sent to API:', modifiedBody);
|
| 69 |
}
|
| 70 |
|
| 71 |
return proxyReqOpts;
|
|
|
|
| 74 |
|
| 75 |
|
| 76 |
|
|
|
|
|
|
|
|
|
|
| 77 |
app.get("/", (req, res) => {
|
| 78 |
// res.send(This is your OpenAI Reverse Proxy URL: ${baseUrl});
|
| 79 |
});
|