-
Notifications
You must be signed in to change notification settings - Fork 6
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
Replace Hardcoded API Endpoints with Environment Variables #31
Comments
added these vars to .env file are implemented them as need in app |
Hi @anshkarwasra, adding a we can do one thing: update the SAMPLE.env.local with desired values and update readme to advise users to populate their .env.local likewise regarding the variables:
you may go ahead and open a PR whenever you are ready |
Hi @anshkarwasra sir, in my opinion there is no need to add domain name in fetch request url because the api is on same domain as is the frontend. Making extra fields in env file is not needed and creating such fields just make extra fields and increase the efforts for contributors and also during hosting. So imo, the url should be eg- "/api/getCategories" instead of "http://localhost:3000/api/getCategories" I have tried it and works completely fine. If you feel the approach is fine kindly assign to me the issue so that I can resolve it. |
Hi @MadhavDhall, thank you for showing your willingness to resolve the issue. I affirm your proposed implementation, please wait until the issue is assigned to you and then you may open a new PR for the issue. @anshkarwasra, are you still working on this issue? If we do not receive an update from you by tomorrow 2359 hours, we will need to reassign the issue to @MadhavDhall. |
@AyushDharDubey kindly assign me this issue. thanks |
Hi @MadhavDhall, hope you understand |
Hi @AyushDharDubey sir kindly assign me this issue as currently 3 issues are assigned to me but 2 of them have been resolved by me and PR raised. |
Description
All the utility functions in the project currently use hardcoded API endpoints. For example:
Hardcoding URLs can lead to deployment issues when switching between different environments, such as production, staging, or testing. To ensure flexibility and maintainability, these values should be moved to environment variables.
Acceptance Criteria
process.env.NEXT_PUBLIC_API_URL
variable.The text was updated successfully, but these errors were encountered: