angularjs - Angular 2 Electron - Consuming REST-API -


i have electron app, uses angular 2 - in order work needed modify <base href="/"> <base href="./">, relative path in file system. api doesn't work anymore (webclient on localhost works fine, not electron client).

i access api via proxy.conf.json

{   "/api": {     "target": "http://127.0.0.1:4747/ticketsale",     "secure": false   } } 

and error message in javascript console of chromium / electron is:

file:///users/myusername/folder/apps/officeclient_electron/office-client-darwin-x64/office-client.app/contents/resources/app/api/1/initialdata     failed load resource: net::err_file_not_found 

how can tell electron access local resources via relative path , consume api via http?

we enabled cors on webserver , setting allowed consume rest-api different url.

see https://en.wikipedia.org/wiki/cross-origin_resource_sharing details.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -