🔧 chore: replace scratch's asset api with ours - #253
Conversation
Signed-off-by: SimonShiki <sinangentoo@gmail.com>
Signed-off-by: SimonShiki <sinangentoo@gmail.com>
…fault Signed-off-by: SimonShiki <sinangentoo@gmail.com>
alexcui03
left a comment
There was a problem hiding this comment.
cdn url should be set externally by environment variables, instead of coded in source file.
cdn host is required since it's used to load assets (see community source) |
| const NO_CACHE = process.argv.includes('--no-cache'); | ||
| const ASSET_HOST = 'cdn.assets.scratch.mit.edu'; | ||
| const useScratchAssetApi = !!process.env.USE_SCRATCH_ASSET_API; | ||
| const ASSET_HOST = useScratchAssetApi ? 'cdn.assets.scratch.mit.edu' : 'static.codingclip.com'; |
There was a problem hiding this comment.
How about use env SCRATCH_ASSET_HOST instead of USE_SCRATCH_ASSET_API to avoid hard-coded url ?
There was a problem hiding this comment.
there's little chance their asset host would change for now, i think
scratch's server should be used by default, and switching other cdn server should be customized by env var, hardcoding our cdn url in source file is not a good practise since the editor shouldn't depending on a specific running environment or platform. the following changes should be considered:
|
Signed-off-by: SimonShiki <sinangentoo@gmail.com>
Deploying clipcc-preview with
|
| Latest commit: |
0cab71e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f2ad5bb2.clipcc-preview.pages.dev |
| Branch Preview URL: | https://feat-codingclip-infra.clipcc-preview.pages.dev |
Description
Replace Scratch's asset api with ours, to avoid network issues in China.
Partially resolves #193. resolves #251. See #252 for translate/tts solution.
Proposed Changes
Test Coverage
Additional Context