Open dashng opened 8 years ago
It seems that lite-server don't work right for proxy [I think is because lite-server was made to handle SPA's if you use Angular routes]. I try with browser-sync and work (I'm using nodemon and browser-sync). But I don't know if that can handle the angular 2 route. I leave you my try of config the lite server and don't make anything.
if you have some idea how use proxy with lite-server please help this human beings. 👍
Have you tried creating a custom middleware to proxy your calls? This article could be helpful.
This issue is duplicate the solution is #68: at bs-config.js:
let proxy = require('http-proxy-middleware');
let fallback = require('connect-history-api-fallback');
module.exports = {
server: {
middleware: {
1: proxy('/', {target: 'http://localhost:8000', changeOrigin: false }),
2: fallback({index: '/index.html', verbose: true})
}
},
};
package.json:
lite-server start -c bs-config.js
And thats the way we like it! 😎
@pablocarreraes Thanks! its work for my problem, thanks!
I need to proxy pass https server to local, it doest work.
Does anyone have any suggestions on this?
Thanks.