03-08-2018 09:03 AM
I have a virtual machine with Ubuntu on it. There my Alfresco Content System is running.
On my host system (MacOS) I can access the share application with the right IP address in the Browser.
Now I created a new ADF application on my host system. Everything alright. I changed the proxy.conf.json to point the "/alfresco" to my IP address and port (http://192.168.52.10:8080).
So when I start the System I see the application but I can't login. I get invalid username/password.
However when I look into the Network tab I see that the ticket request is aborted after some time. Also the Url points to the localhost:4200 and not to my IP address.
03-08-2018 09:51 AM
Hi,
Few questions:
03-08-2018 10:12 AM
I now changed it in the app.config.json didn't notice the ecmHost value. However it still wont work, even though the Network Request now points to the correct URL.
1. Alfresco 5.1
2. app.config.json
{
"$schema": "../node_modules/@alfresco/adf-core/app.config.schema.json",
"ecmHost": "http://192.168.52.10",
"bpmHost": "http://{hostname}{:port}",
"application": {
"name": "Alfresco ADF Appplication"
},
"languages": [
{
"key": "en",
"label": "English"
},
{
"key": "fr",
"label": "French"
},
{
"key": "de",
"label": "German"
},
{
"key": "it",
"label": "Italian"
},
{
"key": "es",
"label": "Spanish"
},
{
"key": "ja",
"label": "Japanese"
},
{
"key": "nl",
"label": "Dutch"
},
{
"key": "pt-BR",
"label": "Brazilian Portuguese"
},
{
"key": "nb",
"label": "Norwegian"
},
{
"key": "ru",
"label": "Russian"
},
{
"key": "zh-CN",
"label": "Simplified Chinese"
}
],
"logLevel" : "trace"
}
3. proxy.conf.json
{
"/alfresco": {
"target": "http://192.168.52.10:8080",
"secure": false,
"changeOrigin": true
}
}
03-08-2018 10:47 AM
Proxy and webpack-dev-server must be used only during development. Are you trying to setup production environment with that?
03-08-2018 10:54 AM
No I only just started trying out the ADF and play around a bit with it locally.
03-08-2018 11:11 AM
Leave the app.config.json unedited. The proxy config we have redirects all calls to "/alfresco/*" from the same address the app is running to the proxied address. In your case you change both and then proxy the content that is already coming from the final address.
03-08-2018 11:15 AM
I don't know if I understand you correctly. As I said before, i have left the app.config.json unedited and tried with the proxy.conf.json . However there the request wasnt sent to 192.168.52.10 but to localhost. And the main problem is, that the request seems to timeout with both addresses.
03-09-2018 05:56 AM
Hi Marius,
In order to avoid CORS problem, you need to send the request to the same address where the client application exists.
Is completely fine send the request to your localhost.
Form this point on when you request reach your localhost server where the webpack dev server is up the proxy should take care of this call and redirect it to the right address.
So it should be:
Client Application (API CALL) ---> request hit webpack server localhost:4200 --> webpack proxy intercept the call --> The call will be redirected to the right IP server.
If you don't want to configure all this CORS skip strategy you can disable it on the server but is not a good practice.
I suggest you give a look also to this article:
Explore our Alfresco products with the links below. Use labels to filter content by product module.