-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- rename app.locals.configs to app.locals.paths - load custom config use fileStrategy from yaml config in app.locals
- Loading branch information
1 parent
fd9b1a3
commit 5664303
Showing
9 changed files
with
48 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
dist: path.resolve(__dirname, '..', '..', 'client', 'dist'), | ||
publicPath: path.resolve(__dirname, '..', '..', 'client', 'public'), | ||
imageOutput: path.resolve(__dirname, '..', '..', 'client', 'public', 'images'), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const { FileSources } = require('librechat-data-provider'); | ||
const { initializeFirebase } = require('./Files/Firebase/initialize'); | ||
const loadCustomConfig = require('./Config/loadCustomConfig'); | ||
const paths = require('~/config/paths'); | ||
|
||
/** | ||
* | ||
* Loads custom config and initializes app-wide variables. | ||
* @function AppService | ||
* @param {Express.Application} app - The Express application object. | ||
*/ | ||
const AppService = async (app) => { | ||
const config = (await loadCustomConfig()) ?? {}; | ||
const fileStrategy = config.CDN_PROVIDER ?? FileSources.local; | ||
|
||
if (fileStrategy === FileSources.firebase) { | ||
initializeFirebase(); | ||
} | ||
|
||
app.locals = { | ||
fileStrategy, | ||
paths, | ||
}; | ||
}; | ||
|
||
module.exports = AppService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters