ninomae1001
commited on
Update server.js
Browse files
server.js
CHANGED
@@ -2,11 +2,9 @@ const express = require('express');
|
|
2 |
const proxy = require('express-http-proxy');
|
3 |
const app = express();
|
4 |
const targetUrl = 'https://api.openai.com'; // OpenAI API endpoint
|
5 |
-
const openai_key = process.env.OPENAI_KEY
|
6 |
app.use('/hf/', proxy(targetUrl, {
|
7 |
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
|
8 |
// Modify the request headers if necessary
|
9 |
-
// proxyReqOpts.headers['Authorization'] = 'Bearer ' + openai_key;
|
10 |
return proxyReqOpts;
|
11 |
},
|
12 |
}));
|
|
|
2 |
const proxy = require('express-http-proxy');
|
3 |
const app = express();
|
4 |
const targetUrl = 'https://api.openai.com'; // OpenAI API endpoint
|
|
|
5 |
app.use('/hf/', proxy(targetUrl, {
|
6 |
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
|
7 |
// Modify the request headers if necessary
|
|
|
8 |
return proxyReqOpts;
|
9 |
},
|
10 |
}));
|