Skip to content

Commit

Permalink
Merge pull request #119 from entando/ENG-1666-when-deployed-a-widget-…
Browse files Browse the repository at this point in the history
…mfe-fails-because-its-not-calling-the-correct-microservice-endpoint

ENG-1666: Explicitly add the "/api" path prefix to the FE api call
  • Loading branch information
w-caffiero-entando authored Dec 29, 2020
2 parents 35e8784 + c185e19 commit c34b145
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%# { "useBluePrint": true } -%>
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>/api
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>
REACT_APP_KEYCLOAK_URL=http://localhost:9080/auth
REACT_APP_KEYCLOAK_REALM=jhipster
REACT_APP_KEYCLOAK_CLIENT_ID=web_app
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%# { "useBluePrint": true } -%>
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>/api
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>
REACT_APP_KEYCLOAK_URL=http://localhost:9080/auth
REACT_APP_KEYCLOAK_REALM=jhipster
REACT_APP_KEYCLOAK_CLIENT_ID=web_app
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<#-- entando_resource_injection_point -->
<#-- Don't add anything above this line. The build scripts will automatically link the compiled JS and CSS for you and add them above this line so that the widget can be loaded-->

<<%= entityFileName %>-details service-url="/<%= baseName %>/api" />
<<%= entityFileName %>-details service-url="/<%= baseName %>" />
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%# { "useBluePrint": true, "renameTo": "`/${generator.entityFileName}/detailsWidget/src/api/${generator.entityInstance}.js`" } -%>
import { getDefaultOptions, request } from 'api/helpers';

const resource = '<%= entityApiUrl %>';
const resource = 'api/<%= entityApiUrl %>';

/* eslint-disable-next-line import/prefer-default-export */
export const api<%= entityClass %>Get = async (serviceUrl, id) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%# { "useBluePrint": true } -%>
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>/api
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>
REACT_APP_KEYCLOAK_URL=http://localhost:9080/auth
REACT_APP_KEYCLOAK_REALM=jhipster
REACT_APP_KEYCLOAK_CLIENT_ID=web_app
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%# { "useBluePrint": true } -%>
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>/api
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>
REACT_APP_KEYCLOAK_URL=http://localhost:9080/auth
REACT_APP_KEYCLOAK_REALM=jhipster
REACT_APP_KEYCLOAK_CLIENT_ID=web_app
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
<#-- Don't add anything above this line. The build scripts will automatically link the compiled JS and CSS for you and add them above this line so that the widget can be loaded-->

<#-- This is the custom element -->
<<%= entityFileName %>-form service-url="/<%= baseName %>/api" />
<<%= entityFileName %>-form service-url="/<%= baseName %>" />
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%# { "useBluePrint": true, "renameTo": "`/${generator.entityFileName}/formWidget/src/api/${generator.entityInstancePlural}.js`" } -%>
import { getDefaultOptions, request } from 'api/helpers';

const resource = '<%= entityApiUrl %>';
const resource = 'api/<%= entityApiUrl %>';

export const api<%= entityClass %>Get = async (serviceUrl, id) => {
const url = `${serviceUrl}/${resource}/${id}`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%# { "useBluePrint": true } -%>
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>/api
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>
REACT_APP_KEYCLOAK_URL=http://localhost:9080/auth
REACT_APP_KEYCLOAK_REALM=jhipster
REACT_APP_KEYCLOAK_CLIENT_ID=web_app
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%# { "useBluePrint": true } -%>
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>/api
REACT_APP_SERVICE_URL=http://localhost:<%= serverPort %>/services/<%= baseName %>
REACT_APP_KEYCLOAK_URL=http://localhost:9080/auth
REACT_APP_KEYCLOAK_REALM=jhipster
REACT_APP_KEYCLOAK_CLIENT_ID=web_app
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
<#-- Don't add anything above this line. The build scripts will automatically link the compiled JS and CSS for you and add them above this line so that the widget can be loaded-->

<#-- This is the custom element -->
<<%= entityFileName %>-table service-url="/<%= baseName %>/api" />
<<%= entityFileName %>-table service-url="/<%= baseName %>" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { getFilterQuery } from 'components/filters/utils';
import { getDefaultOptions, request, getUrl } from 'api/helpers';

const resource = '<%= entityApiUrl %>';
const resource = 'api/<%= entityApiUrl %>';

export const api<%= entityClassPlural %>Delete = async (serviceUrl, id) => {
const url = `${serviceUrl}/${resource}/${id}`;
Expand Down

0 comments on commit c34b145

Please sign in to comment.