mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
feat: support config host name and proxy address
This commit is contained in:
parent
fb9f77ae5e
commit
06c99154ac
4 changed files with 32 additions and 28 deletions
|
|
@ -7,6 +7,7 @@ const clientOptions = {
|
||||||
// Access token from https://chat.openai.com/api/auth/session
|
// Access token from https://chat.openai.com/api/auth/session
|
||||||
accessToken: process.env.CHATGPT_TOKEN,
|
accessToken: process.env.CHATGPT_TOKEN,
|
||||||
// debug: true
|
// debug: true
|
||||||
|
proxy: process.env.PROXY || null,
|
||||||
};
|
};
|
||||||
|
|
||||||
const browserClient = async ({ text, progressCallback, convo }) => {
|
const browserClient = async ({ text, progressCallback, convo }) => {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ const clientOptions = {
|
||||||
modelOptions: {
|
modelOptions: {
|
||||||
model: 'gpt-3.5-turbo'
|
model: 'gpt-3.5-turbo'
|
||||||
},
|
},
|
||||||
|
proxy: process.env.PROXY || null,
|
||||||
debug: false
|
debug: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ const clientOptions = {
|
||||||
modelOptions: {
|
modelOptions: {
|
||||||
model: 'gpt-3.5-turbo'
|
model: 'gpt-3.5-turbo'
|
||||||
},
|
},
|
||||||
|
proxy: process.env.PROXY || null,
|
||||||
debug: false
|
debug: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,29 @@
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const dbConnect = require('../models/dbConnect');
|
const dbConnect = require('../models/dbConnect');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const cors = require('cors');
|
const cors = require('cors');
|
||||||
const routes = require('./routes');
|
const routes = require('./routes');
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = process.env.PORT || 3080;
|
const port = process.env.PORT || 3080;
|
||||||
const projectPath = path.join(__dirname, '..', '..', 'client');
|
const host = process.env.HOST || 'localhost'
|
||||||
dbConnect().then(() => console.log('Connected to MongoDB'));
|
const projectPath = path.join(__dirname, '..', '..', 'client');
|
||||||
|
dbConnect().then(() => console.log('Connected to MongoDB'));
|
||||||
app.use(cors());
|
|
||||||
app.use(express.json());
|
app.use(cors());
|
||||||
app.use(express.static(path.join(projectPath, 'public')));
|
app.use(express.json());
|
||||||
|
app.use(express.static(path.join(projectPath, 'public')));
|
||||||
app.get('/', function (req, res) {
|
|
||||||
console.log(path.join(projectPath, 'public', 'index.html'));
|
app.get('/', function (req, res) {
|
||||||
res.sendFile(path.join(projectPath, 'public', 'index.html'));
|
console.log(path.join(projectPath, 'public', 'index.html'));
|
||||||
});
|
res.sendFile(path.join(projectPath, 'public', 'index.html'));
|
||||||
|
});
|
||||||
app.use('/api/ask', routes.ask);
|
|
||||||
app.use('/api/messages', routes.messages);
|
app.use('/api/ask', routes.ask);
|
||||||
app.use('/api/convos', routes.convos);
|
app.use('/api/messages', routes.messages);
|
||||||
app.use('/api/customGpts', routes.customGpts);
|
app.use('/api/convos', routes.convos);
|
||||||
app.use('/api/prompts', routes.prompts);
|
app.use('/api/customGpts', routes.customGpts);
|
||||||
|
app.use('/api/prompts', routes.prompts);
|
||||||
app.listen(port, () => {
|
|
||||||
console.log(`Server listening at http://localhost:${port}`);
|
app.listen(port, host, () => {
|
||||||
});
|
console.log(`Server listening at http://${host}:${port}`);
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue