Spaces:
Running
Running
Update server.js
Browse files
server.js
CHANGED
@@ -1,12 +1,9 @@
|
|
1 |
const express = require('express');
|
2 |
const proxy = require('express-http-proxy');
|
3 |
const app = express();
|
4 |
-
const targetUrl = 'https://
|
5 |
-
const openai_key = process.env.OPENAI_KEY
|
6 |
app.use('/', 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 |
}));
|
|
|
1 |
const express = require('express');
|
2 |
const proxy = require('express-http-proxy');
|
3 |
const app = express();
|
4 |
+
const targetUrl = 'https://platform.openai.com/playground';
|
|
|
5 |
app.use('/', proxy(targetUrl, {
|
6 |
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
|
|
|
|
|
7 |
return proxyReqOpts;
|
8 |
},
|
9 |
}));
|