Skip to content

Gateway - stop hard coding urls #651

Merged
thetechnocrat-dev merged 3 commits intomainfrom
ops/backend-url-from-env
Sep 14, 2023
Merged

Gateway - stop hard coding urls #651
thetechnocrat-dev merged 3 commits intomainfrom
ops/backend-url-from-env

Conversation

@hevans66
Copy link
Copy Markdown
Contributor

@hevans66 hevans66 commented Sep 13, 2023

Adds two new env variables

NEXT_PUBLIC_BACKEND_URL=http://localhost:8080
FRONTEND_URL=http://localhost:3000

NEXT_PUBLIC_BACKEND_URL is used by frontend to know which backend to use.
FRONTEND_URL is used by backend for CORS allowed origins

I tried to look for a standard way of importing these "configuration" type functions in nextjs but could not find a consistent answer. I stuck it in lib since we already had a lib folder. Let me know if you prefer somewhere else.

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
docs ⬜️ Ignored (Inspect) Sep 13, 2023 8:00pm

@hevans66 hevans66 temporarily deployed to ci September 13, 2023 20:00 — with GitHub Actions Inactive
Copy link
Copy Markdown

@thetechnocrat-dev thetechnocrat-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked for me locally 💯

@thetechnocrat-dev thetechnocrat-dev merged commit 7627833 into main Sep 14, 2023
@thetechnocrat-dev thetechnocrat-dev deleted the ops/backend-url-from-env branch September 14, 2023 13:16
thetechnocrat-dev pushed a commit that referenced this pull request Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants