Skip to content

Commit

Permalink
update staging pattern
Browse files Browse the repository at this point in the history
Signed-off-by: Prince Mendiratta <[email protected]>
  • Loading branch information
Prince-Mendiratta committed Mar 23, 2023
1 parent e415cc2 commit 85af209
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions config/proxyConfig.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* These are the base API root used to send requests to the proxy.
* These are the base API roots used to send requests to the proxy.
* We only specify for staging URLs as API requests are sent to the production
* servers by default.
*/
module.exports = {
STAGING: '/staging-',
STAGING_SECURE: '/staging-secure-',
STAGING: '/staging/',
STAGING_SECURE: '/staging-secure/',
};
6 changes: 3 additions & 3 deletions web/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const server = http.createServer((request, response) => {
* the actual server request must use the /api path.
* For example,
* /api?command=OpenReport => request sent to production server
* /staging-api?command=OpenReport => request sent to staging server
* /staging-secure-api?command=OpenReport => request sent to secure staging server
* /staging/api?command=OpenReport => request sent to staging server
* /staging-secure/api?command=OpenReport => request sent to secure staging server
* /chat-attachments/46545... => request sent to production server
* /staging-chat-attachments/46545... => request sent to staging server
* /staging/chat-attachments/46545... => request sent to staging server
*/
if (request.url.startsWith(proxyConfig.STAGING_SECURE)) {
hostname = stagingSecureHost;
Expand Down

0 comments on commit 85af209

Please sign in to comment.