Skip to content

Commit 53ae95f

Browse files
committed
refactor: Renamed NEXT_PUBLIC_UPLOADCARE_APP_BASE_PATH to NEXT_PUBLIC_UPLOADCARE_APP_BASE_URL.
1 parent 9c8be4c commit 53ae95f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ Alternatively, in case you're using a custom proxy, set the proxy domain.
5858
NEXT_PUBLIC_UPLOADCARE_CUSTOM_PROXY_DOMAIN="proxy.example.com"
5959
```
6060

61-
Then set the app base path (to get relative image urls processed in Production):
61+
Then set the app base url (to get relative image urls processed in Production):
6262

6363
```ini
6464
#.env
65-
NEXT_PUBLIC_UPLOADCARE_APP_BASE_PATH="https://example.com/"
65+
NEXT_PUBLIC_UPLOADCARE_APP_BASE_URL="https://example.com/"
6666
```
6767

6868
That's it. You may now use `@uploadcare/nextjs-loader` in your app (see [Usage](#usage)).

build/utils/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function uploadcareLoader({ src, width, quality }) {
1212
? (0, helpers_1.generateDefaultProxyEndpoint)(customProxyDomain)
1313
: null;
1414
const proxyEndpoint = customProxyEndpoint || (0, helpers_1.generateDefaultProxyEndpoint)(publicKey);
15-
const basePath = (0, helpers_1.trimTrailingSlash)(process.env.NEXT_PUBLIC_UPLOADCARE_APP_BASE_PATH || '');
15+
const basePath = (0, helpers_1.trimTrailingSlash)(process.env.NEXT_PUBLIC_UPLOADCARE_APP_BASE_URL || '');
1616
const proxy = (0, helpers_1.trimTrailingSlash)(proxyEndpoint);
1717
const isOnCdn = (0, helpers_1.isCdnUrl)(src, cdnDomain);
1818
if (!(0, helpers_1.isProduction)() && !isOnCdn) {

src/__tests__/uploadcare-loader.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('uploadcareLoader', () => {
4242
// When the base path is set through env vars.
4343

4444
const basePath = 'https://example.com';
45-
addEnvVar('NEXT_PUBLIC_UPLOADCARE_APP_BASE_PATH', basePath);
45+
addEnvVar('NEXT_PUBLIC_UPLOADCARE_APP_BASE_URL', basePath);
4646

4747
result = uploadcareLoader({
4848
src,
@@ -52,7 +52,7 @@ describe('uploadcareLoader', () => {
5252

5353
expect(result).toEqual(`${basePath}${src}`);
5454

55-
removeEnvVar('NEXT_PUBLIC_UPLOADCARE_APP_BASE_PATH');
55+
removeEnvVar('NEXT_PUBLIC_UPLOADCARE_APP_BASE_URL');
5656
removeEnvVar('NEXT_PUBLIC_UPLOADCARE_PUBLIC_KEY');
5757
removeEnvVar('NODE_ENV');
5858
});

src/utils/loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function uploadcareLoader({
3939
customProxyEndpoint || generateDefaultProxyEndpoint(publicKey);
4040

4141
const basePath = trimTrailingSlash(
42-
process.env.NEXT_PUBLIC_UPLOADCARE_APP_BASE_PATH || ''
42+
process.env.NEXT_PUBLIC_UPLOADCARE_APP_BASE_URL || ''
4343
);
4444

4545
const proxy = trimTrailingSlash(proxyEndpoint);

0 commit comments

Comments
 (0)