Spaces:
Building
Building
waxihiv547
commited on
Commit
•
5af1179
1
Parent(s):
38e3b27
Update server.js
Browse files
server.js
CHANGED
@@ -1,20 +1,15 @@
|
|
1 |
const express = require('express');
|
2 |
const proxy = require('express-http-proxy');
|
3 |
const app = express();
|
4 |
-
const
|
5 |
-
const port = 7860;
|
6 |
|
7 |
-
|
8 |
-
// app.use(express.urlencoded({ limit: '10mb', extended: true }));
|
9 |
-
|
10 |
-
app.use('/', proxy(targetUrl, {
|
11 |
https: true,
|
12 |
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
|
13 |
-
// console.log(srcReq);
|
14 |
return proxyReqOpts;
|
15 |
},
|
16 |
}));
|
17 |
|
18 |
-
app.listen(
|
19 |
-
console.log(`
|
20 |
});
|
|
|
1 |
const express = require('express');
|
2 |
const proxy = require('express-http-proxy');
|
3 |
const app = express();
|
4 |
+
const z = 'language'
|
|
|
5 |
|
6 |
+
app.use('/', proxy(`https://generative${z}.googleapis.com`, {
|
|
|
|
|
|
|
7 |
https: true,
|
8 |
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
|
|
|
9 |
return proxyReqOpts;
|
10 |
},
|
11 |
}));
|
12 |
|
13 |
+
app.listen(7860, () => {
|
14 |
+
console.log(`YES`);
|
15 |
});
|