waxihiv547 commited on
Commit
5af1179
1 Parent(s): 38e3b27

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +4 -9
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 targetUrl = 'https://generativelanguage.googleapis.com';
5
- const port = 7860;
6
 
7
- // app.use(express.json({ limit: '10mb' }));
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(port, () => {
19
- console.log(`GRP`);
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
  });