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

Updated how API is called so it can support both client-side and server-side calls in a secure way #4

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

timwekkenbc
Copy link
Collaborator

This removes the need to have an exposed API endpoint.

The issue was that Nextjs can make both client-side and server-side requests. The server side requests couldn't make use of the Keycloak credentials so they required an open API endpoint.

With this change the server-side requests can use the OpenShift service directly like http://brms-api:3000/api and the client side can use just /api with its Keycloak credentials.

I also update the Nextjs config to be inline with our OpenShift deployment that has the API accessible to the frontend at api

Note: I skipped the usual process and already merged this into dev because I wasn't sure if it would work or not.

@timwekkenbc timwekkenbc requested a review from brysonjbest June 4, 2024 23:26
@timwekkenbc timwekkenbc self-assigned this Jun 4, 2024
Copy link
Collaborator

@brysonjbest brysonjbest left a comment

Choose a reason for hiding this comment

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

Looks great. Really like the implementation support for server-side API calls, and the consolidation of the API_URI.

@timwekkenbc timwekkenbc merged commit c9750e9 into main Jun 6, 2024
8 checks passed
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