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
4e616cd2ed
commit
67156f4a7a
5 changed files with 13 additions and 3 deletions
|
|
@ -1,7 +1,13 @@
|
||||||
OPENAI_KEY=
|
OPENAI_KEY=
|
||||||
|
HOST=
|
||||||
PORT=3080
|
PORT=3080
|
||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
|
|
||||||
# Change this to your MongoDB URI if different and I recommend appending chatgpt-clone
|
# Change this to your MongoDB URI if different and I recommend appending chatgpt-clone
|
||||||
MONGO_URI="mongodb://127.0.0.1:27017/chatgpt-clone"
|
MONGO_URI="mongodb://127.0.0.1:27017/chatgpt-clone"
|
||||||
|
|
||||||
|
# Change this to proxy any request.
|
||||||
|
PROXY=
|
||||||
|
|
||||||
CHATGPT_TOKEN=""
|
CHATGPT_TOKEN=""
|
||||||
BING_TOKEN=""
|
BING_TOKEN=""
|
||||||
|
|
@ -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
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ 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 host = process.env.HOST || 'localhost'
|
||||||
const projectPath = path.join(__dirname, '..', '..', 'client');
|
const projectPath = path.join(__dirname, '..', '..', 'client');
|
||||||
dbConnect().then(() => console.log('Connected to MongoDB'));
|
dbConnect().then(() => console.log('Connected to MongoDB'));
|
||||||
|
|
||||||
|
|
@ -23,6 +24,6 @@ app.use('/api/convos', routes.convos);
|
||||||
app.use('/api/customGpts', routes.customGpts);
|
app.use('/api/customGpts', routes.customGpts);
|
||||||
app.use('/api/prompts', routes.prompts);
|
app.use('/api/prompts', routes.prompts);
|
||||||
|
|
||||||
app.listen(port, () => {
|
app.listen(port, host, () => {
|
||||||
console.log(`Server listening at http://localhost:${port}`);
|
console.log(`Server listening at http://${host}:${port}`);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue