Rooni's picture
Update server.js
43f02ea verified
raw
history blame
No virus
414 Bytes
const express = require('express');
const proxy = require('express-http-proxy');
const app = express();
const targetUrl = 'https://platform.openai.com'; // OpenAI API endpoint
app.use('/', proxy(targetUrl, {
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
return proxyReqOpts;
},
}));
const port = 7860;
app.listen(port, () => {
console.log(`Reverse proxy server listening on port ${port}`);
});