forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix: add basePath to support subdirectory (lobehub#1179)
* 🔧 chore: test the base path * 🐛 fix: fix api base path * 🐛 fix: fix api base path * 🐛 fix: fix api base path * 🐛 fix: fix image base path * 🐛 fix: fix api base path * 🐛 fix: fix image base path * 🐛 fix: fix manifest.json * 🐛 fix: fix manifest.json * ✅ test: fix test * 🔧 chore: clean code * 🔧 chore: clean code * 📝 docs: update docs * 🐛 fix: fix api base path * ✅ test: fix test * 🐛 fix: fix image base path * 🐛 fix: fix image base path
- Loading branch information
Showing
22 changed files
with
103 additions
and
46 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
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
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
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
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,21 +1,39 @@ | ||
export const URLS = { | ||
/* eslint-disable sort-keys-fix/sort-keys-fix */ | ||
import { transform } from 'lodash-es'; | ||
|
||
import { withBasePath } from '@/utils/basePath'; | ||
|
||
const mapWithBasePath = <T extends object>(apis: T): T => { | ||
return transform(apis, (result, value, key) => { | ||
if (typeof value === 'string') { | ||
// @ts-ignore | ||
result[key] = withBasePath(value); | ||
} else { | ||
result[key] = value; | ||
} | ||
}); | ||
}; | ||
|
||
export const API_ENDPOINTS = mapWithBasePath({ | ||
config: '/api/config', | ||
market: '/api/market', | ||
proxy: '/api/proxy', | ||
}; | ||
|
||
export const PLUGINS_URLS = { | ||
// agent markets | ||
market: '/api/market', | ||
|
||
// plugins | ||
gateway: '/api/plugin/gateway', | ||
store: '/api/plugin/store', | ||
}; | ||
pluginStore: '/api/plugin/store', | ||
|
||
export const OPENAI_URLS = { | ||
// chat | ||
chat: (provider: string) => withBasePath(`/api/chat/${provider}`), | ||
|
||
// image | ||
images: '/api/openai/images', | ||
|
||
// TTS & STT | ||
stt: '/api/openai/stt', | ||
tts: '/api/openai/tts', | ||
}; | ||
|
||
export const TTS_URL = { | ||
edge: '/api/tts/edge-speech', | ||
microsoft: '/api/tts/microsoft-speech', | ||
}; | ||
}); |
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
Oops, something went wrong.