Remove hard-coded baseUrl from SyndesisRest
import * as React from 'react';
+import { AppContext } from '../AppContext';
import { AuthContext } from '../auth';
import { IRestState, Rest } from './Rest';
import { Stream } from './Stream';
@@ -22,10 +23,12 @@ export class SyndesisRest<T> extends React.Component<ISyndesisRestProps<T>> {
const RestOrStream = stream ? Stream : Rest;
return (
+ <AppContext.Consumer>
+ {({apiUri}) =>
<AuthContext.Consumer>
{({token}) => (
<RestOrStream
- baseUrl={'http://syndesis-server-syndesis.192.168.64.16.nip.io'}
+ baseUrl={apiUri}
url={url}
{...props}
headers={{
@@ -36,6 +39,8 @@ export class SyndesisRest<T> extends React.Component<ISyndesisRestProps<T>> {
/>
)}
</AuthContext.Consumer>
+ }
+ </AppContext.Consumer>
)
}
}
