Merge pull request #6 from navi-infra/ch11577

[ch11577] | Abhishek | Make backend URL an environment variable
This commit is contained in:
Abhishek Katiyar
2020-05-27 12:12:36 +05:30
committed by GitHub Enterprise
5 changed files with 6 additions and 4 deletions

View File

@@ -4,4 +4,5 @@ window.config = {
CLIENT_ID: '0oaa0a9up1F7lQc5A4x6',
SCOPE: 'openid groups',
RESPONSE_TYPE: 'id_token',
BACKEND_URL: 'https://deployment-portal-backend.np.navi-tech.in'
}

View File

@@ -10,4 +10,5 @@ services:
- REDIRECT_URI=http://localhost:3000/implicit/callback
- CLIENT_ID=0oaa0a9up1F7lQc5A4x6
- SCOPE=openid groups
- RESPONSE_TYPE=id_token
- RESPONSE_TYPE=id_token
- BACKEND_URL=https://deployment-portal-backend.np.navi-tech.in

1
src/AppConfig.d.ts vendored
View File

@@ -1,5 +1,6 @@
export interface AppConfig {
ISSUER: string,
BACKEND_URL: string,
REDIRECT_URI: string,
RESPONSE_TYPE: string,
SCOPE: string,

View File

@@ -50,8 +50,7 @@ const Form = () => {
const handleSubmit = async (values: any ): Promise<void> => {
console.log(values);
fetch('http://localhost:9090/manifest', {
fetch(`${window.config.BACKEND_URL}/manifest`, {
method: 'POST',
headers: {
Accept: 'application/json',

View File

@@ -52,7 +52,7 @@ const ShowDeploymentManifest = () => {
console.log("...." + serviceName + environment);
const {idToken} = authState;
fetch(
`http://localhost:9090/manifest/${serviceName}/${environment}`,
`${window.config.BACKEND_URL}/manifest/${serviceName}/${environment}`,
{
method: 'GET',
headers: {