Skip to content

Commit

Permalink
Addressed the changes requested on my PR by K to fix the setup file
Browse files Browse the repository at this point in the history
  • Loading branch information
Hedgemon4 committed Jan 19, 2024
1 parent 693ab88 commit 411911c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
/** @type {import("next").NextConfig} */
const nextConfig = () => {
const environmentVariables = [
'NEXT_PUBLIC_BASE_URL',
'NEXT_IMAGE_WHITELIST_HOSTNAMES',
'DATABASE_URL',
'NEXT_PUBLIC_GOOGLE_CLIENT_ID',
'NEXT_PUBLIC_GOOGLE_CLIENT_SECRET',
'NEXT_PUBLIC_NEXTAUTH_SECRET',
'AWS_UPLOAD_BUCKET',
'AWS_UPLOAD_REGION',
]

// Check if all environment variables are set
const missingVariables = environmentVariables.filter((variable) => !process.env[variable])
if (missingVariables.length > 0) {
const errorMessage = `The environment variables are missing: ${ missingVariables.join(', ') }`
throw new ReferenceError(errorMessage)
}

return {
images: {
domains: process.env.NEXT_IMAGE_WHITELIST_HOSTNAMES.split(' '),
Expand Down

0 comments on commit 411911c

Please sign in to comment.