I'm trying to download via api rest, my application works fine with api, but when I try to request files, PDF for example it returns the following error:
[HPM] Error occurred while trying to proxy request /api/v1/invoices/5aa030e1e1bfd700105eaee5 from localhost:4200 to 145.239.197.46 (HPE_INVALID_CONSTANT) (https://nodejs.org/api/errors.html#errors_common_system_errors)
My proxy.conf.json file is configured as follows:
{
"/api": {
"target": {
"host": "145.239.197.46",
"protocol": "http:",
"port": 8000
},
"secure": false,
"changeOrigin": true,
"logLevel": "info"
}
}
and my configuration .lang-cli-json is with the script as follows:
"scripts": {
"ng": "ng",
"conventional-changelog": "conventional-changelog",
"start": "ng serve --proxy-config proxy.conf.json --host 0.0.0.0 --port 4200",
"build": "ng build",
"build:prod": "npm run build -- --prod --aot",
"test": "ng test -sr",
"test:coverage": "rimraf coverage && npm run test -- -cc",
"lint": "ng lint --type-check",
"lint:fix": "ng lint --fix",
"lint:styles": "stylelint ./src/**/*.scss",
"lint:ci": "npm run lint && npm run lint:styles",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "ng e2e",
"docs": "compodoc -p src/tsconfig.app.json -d docs",
"docs:serve": "compodoc -p src/tsconfig.app.json -d docs -s",
"prepush": "npm run lint:ci",
"release:changelog": "npm run conventional-changelog -- -p angular -i CHANGELOG.md -s"
},
I'm using angular 2/4 Any suggestion of what can cause this? Thank you.