gemrp / server.js
Vladimir Alabov
'gpr'
8db509b
raw
history blame
451 Bytes
const express = require('express');
const proxy = require('express-http-proxy');
const app = express();
const targetUrl = 'https://generativelanguage.googleapis.com';
const port = 7860;
const baseUrl = 'gem';
app.use('/', proxy(targetUrl, {
https: true,
proxyReqOptDecorator: (proxyReqOpts, srcReq) => {
// console.log(srcReq);
return proxyReqOpts;
},
}));
app.get("/", (req, res) => {
res.send(`This is your GRP URL: ${baseUrl}`);
});