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

Add proxy functionality. Re-enable local conf. #494

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Add proxy functionality. Re-enable local conf. #494

merged 1 commit into from
Dec 20, 2023

Conversation

rpiaggio
Copy link
Contributor

The UI needs to connect to a second server, which provides an API to connect directly to Navigate's DB.

We can either:

  1. Open the server's port to the world.
  2. Deploy static files through an nginx server, and configure it as a proxy to both servers.
  3. Have the existing server act as a proxy to the other server.

This PR implements option #3. Requests made to /db/* will be forwarded to the other server, stripping /db. The other server's base URI is configurable in app.conf.

Additionally, it reinstantes correctly reading app.conf from resources in development. This was broken when I implemented packaging.

@codecov-commenter
Copy link

Codecov Report

Attention: 32 lines in your changes are missing coverage. Please review.

Comparison is base (0cb8679) 28.39% compared to head (45e9ff4) 27.71%.

Files Patch % Lines
...navigate/web/server/http4s/WebServerLauncher.scala 0.00% 20 Missing ⚠️
...cala/navigate/web/server/http4s/ProxyBuilder.scala 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #494      +/-   ##
==========================================
- Coverage   28.39%   27.71%   -0.69%     
==========================================
  Files          47       48       +1     
  Lines        1222     1252      +30     
  Branches        6        7       +1     
==========================================
  Hits          347      347              
- Misses        875      905      +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@jluhrs jluhrs left a comment

Choose a reason for hiding this comment

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

LGTM

@jluhrs jluhrs merged commit b9b42b9 into main Dec 20, 2023
6 checks passed
@jluhrs jluhrs deleted the proxy branch December 20, 2023 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants