Skip to content

Commit 59acbd7

Browse files
authored
Merge pull request #333 from developmentseed/fix/vercel-url
Check if Vercel URL is available before adding protocol
2 parents f72999f + bb89435 commit 59acbd7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

next.config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
require('dotenv').config()
22

3+
const vercelUrl =
4+
process.env.NEXT_PUBLIC_VERCEL_URL &&
5+
`https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
6+
37
module.exports = {
48
serverRuntimeConfig: {
59
NODE_ENV: process.env.NODE_ENV || 'development',
@@ -20,10 +24,7 @@ module.exports = {
2024
},
2125
basePath: process.env.BASE_PATH || '',
2226
env: {
23-
APP_URL:
24-
process.env.APP_URL ||
25-
`https://${process.env.NEXT_PUBLIC_VERCEL_URL}` ||
26-
'http://127.0.0.1:3000',
27+
APP_URL: process.env.APP_URL || vercelUrl || 'http://127.0.0.1:3000',
2728
OSM_NAME: process.env.OSM_NAME || 'OSM',
2829
BASE_PATH: process.env.BASE_PATH || '',
2930
},

0 commit comments

Comments
 (0)