ninomae1001's picture
Update server.js
65fafd9 verified
raw
history blame contribute delete
462 Bytes
const express = require('express');
const proxy = require('express-http-proxy');
const app = express();
const targetUrl = 'https://integrate.api.nvidia.com'; // OpenAI API endpoint
app.use('/hf/', proxy(targetUrl, {
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
// Modify the request headers if necessary
return proxyReqOpts;
},
}));
const port = 7860;
app.listen(port, () => {
console.log(`Reverse proxy server listening on port ${port}`);
});