Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

ngx-translate access other baseurl #56

Closed
pbkh-bunthai opened this issue Sep 1, 2018 · 2 comments
Closed

ngx-translate access other baseurl #56

pbkh-bunthai opened this issue Sep 1, 2018 · 2 comments

Comments

@pbkh-bunthai
Copy link

I use this url to load my Login Ui: http://localhost:5000/login.
But in console, it printed error: http://localhost:8081/api/assets/i18n/ja.json 401 (Unauthorized).
It access to my api url.
It should be access this url http://localhost:5000/assets/i18n/ja.json instead.
I do a simple configuration.

export function createTranslateLoader(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

I found this configuration in my project:

{
  "bffBaseUrl": "http://localhost:8081"
}

How can I make it access to http://localhost:5000/assets/i18n/ja.json ?

@aicokleinovink
Copy link

I run into the same problem, what was your solution here??

@pbkh-bunthai
Copy link
Author

pbkh-bunthai commented May 29, 2019

@aicokleinovink

I used this way, it's working fine:

export function createTranslateLoader(http: HttpClient) {
  return new TranslateHttpLoader(http, window.location.origin + '/assets/i18n/json/', '.json');
}

I hope it work for you! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants