Spaces:
Running
Running
Update server.js
Browse files
server.js
CHANGED
@@ -1,13 +1,16 @@
|
|
1 |
const express = require('express');
|
2 |
-
const
|
|
|
3 |
const app = express();
|
4 |
-
|
5 |
-
app.
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
})
|
10 |
-
|
|
|
|
|
11 |
app.listen(port, () => {
|
12 |
-
console.log(
|
13 |
});
|
|
|
1 |
const express = require('express');
|
2 |
+
const request = require('request');
|
3 |
+
|
4 |
const app = express();
|
5 |
+
|
6 |
+
app.get('/*', (req, res) => {
|
7 |
+
const url = 'https://platform.openai.com' + req.url;
|
8 |
+
|
9 |
+
req.pipe(request(url)).pipe(res);
|
10 |
+
});
|
11 |
+
|
12 |
+
const port = 8080; // Выберите любой свободный порт
|
13 |
+
|
14 |
app.listen(port, () => {
|
15 |
+
console.log(`Прокси-сервер запущен на порту ${port}`);
|
16 |
});
|