-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: runtime env variables with next-runtime-env
- Loading branch information
1 parent
5286f23
commit 2fa627f
Showing
15 changed files
with
4,025 additions
and
3,147 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
NEXT_PUBLIC_ARKE_SERVER_URL=http://0.0.0.0:4000 | ||
NEXT_MULTIPROJECT=true | ||
NEXTAUTH_URL=http://localhost:3100/api/auth | ||
NEXTAUTH_SECRET=your_secret | ||
NEXT_PUBLIC_ARKE_SERVER_URL="http://0.0.0.0:4000" | ||
NEXT_PUBLIC_ARKE_PROJECT="" | ||
NEXT_PUBLIC_MULTIPROJECT="true" | ||
NEXTAUTH_URL="http://localhost:3100/api/auth" | ||
NEXTAUTH_SECRET="your_secret" |
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 |
---|---|---|
|
@@ -34,3 +34,6 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# Runtime env | ||
/public/__ENV.js |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Create __ENV.js file in the public directory | ||
echo "window.__ENV = {" > ./public/__ENV.js | ||
|
||
# Loop through all environment variables | ||
for var in $(env | grep '^NEXT_PUBLIC_' | cut -d= -f1); do | ||
# Extract the variable name and value | ||
value=$(printenv "$var") | ||
# Format and append to __ENV.js | ||
echo " $var: \"${value}\"," >> ./public/__ENV.js | ||
done | ||
|
||
# Close the JSON object in __ENV.js | ||
echo "};" >> ./public/__ENV.js | ||
|
||
# Start the server | ||
node server.js |
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
Oops, something went wrong.