Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore belindas nextjs update api evironment #525

Merged
merged 3 commits into from
Aug 3, 2024

Conversation

IsaacJrTypes
Copy link
Contributor

This PR contains a quality of life update! Now you can set the API address from your .env file. If the developer is using a localhost based API address, the API address will be printed to the console.

How to test:

  • Use the .env.sample to help set up your .env file. Once set, use npm run dev and run backend
  • Make sure localhost port number matches with backend port number

@IsaacJrTypes IsaacJrTypes added the enhancement New feature or request label Jul 30, 2024
@IsaacJrTypes IsaacJrTypes requested review from bcko, intisarosman1 and a team July 30, 2024 05:22
@IsaacJrTypes IsaacJrTypes self-assigned this Jul 30, 2024
@IsaacJrTypes IsaacJrTypes requested review from cshimm, keiffer213, heosman, brinkbrink, taylorpapke and ParysUnangst and removed request for a team July 30, 2024 05:22
Copy link
Contributor

@bcko bcko left a comment

Choose a reason for hiding this comment

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

Great job. We would need to document this as well.

@Alzavio Alzavio self-requested a review July 31, 2024 02:14
@Alzavio
Copy link
Contributor

Alzavio commented Jul 31, 2024

Changing the api address via the env seems to be working. I can set it to anything via the env

image
image

@intisarosman1
Copy link
Contributor

How would I test this PR locally? Changing the API address in the env works fine, but I notice that there's issues with signing in and data not being fetched. Usually, I would comment out the env API URL lines on the Sign In page and next.config.js, but how would I do that in this PR?

@IsaacJrTypes
Copy link
Contributor Author

@intisarosman1 I think the issue might the localhost address does not contain the same port value as the backend server.
So If the frontend .env file contains 3005 (API_URL=http://localhost:3005/api) then the backend listening port value should be 3005

Copy link
Contributor

@intisarosman1 intisarosman1 left a comment

Choose a reason for hiding this comment

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

Thank you @IsaacJrTypes, I was able to get it working!
Screenshot 2024-07-31 204244

Copy link
Collaborator

@keiffer213 keiffer213 left a comment

Choose a reason for hiding this comment

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

Works for me as well! Thanks for this!

@keiffer213 keiffer213 merged commit 5ff3ec9 into main Aug 3, 2024
6 checks passed
@keiffer213 keiffer213 deleted the chore-belindas-nextjs-update-API-evironment branch August 3, 2024 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants