angular 2 npm start - how to proxy API requests to another server? -


how can proxy ajax calls different server using npm start. npm start --proxy http://localhost:8080 doesn't work

i did ... 1 option add file:

bs-config.js:

var proxymiddleware = require('http-proxy-middleware');  module.exports = {     server: {         middleware: {             1: proxymiddleware('/api', {                 target: 'http://localhost:8081/',                 changeorigin: true             })         }     } }; 

also run: npm install --save-dev http-proxy-middleware


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -