Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use frontend host as backend host per default #957

Closed
mmabrouk opened this issue Nov 28, 2023 · 1 comment
Closed

Use frontend host as backend host per default #957

mmabrouk opened this issue Nov 28, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mmabrouk
Copy link
Member

The frontend calls the backend using process.env.NEXT_PUBLIC_AGENTA_API_URL

For instnace

export const createAppFromTemplate = async (
    templateObj: AppTemplate,
    ignoreAxiosError: boolean = false,
) => {
    const response = await axios.post(
        `${process.env.NEXT_PUBLIC_AGENTA_API_URL}/api/apps/app_and_variant_from_template/`,
        templateObj,
        {_ignoreError: ignoreAxiosError} as any,
    )
    return response
}

We want to call the same host when NEXT_PUBLIC_AGENTA_API_URL is empty.

One solution is to use ${window.location.host} when NEXT_PUBLIC_AGENTA_API_URL is set

This is needed to fix another issue in deployment

@bekossy
Copy link
Member

bekossy commented Dec 5, 2023

Fixed in #970

@bekossy bekossy closed this as completed Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants