Skip to content

[UI] Interface to Configure the API base url #899

@tnightengale

Description

@tnightengale

Is your feature request related to a problem? Please describe.

To enable eventual production deployments, I think we may need to create an interface to configure the base url from which the UI fetches data from the UC api. This is because the UI may not necessarily be served from the same host as the UC api.

Would an environment variable to set the base url of the UC api host be a good choice?

See here where the CLIENT is only provided with the api route prefix. Therefore I believe this causes the react client to default to the same host, ie. it expects the UC api to be served from the same host.

CC: @jamieknight-db @sdwbgn

import axios from 'axios';
import { UC_API_PREFIX } from '../utils/constants';
/**
* The singleton client instance with `baseURL`.
*/
export const CLIENT = axios.create({
baseURL: `${UC_API_PREFIX}`,
headers: {
'Content-type': 'application/json',
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions