lite-server icon indicating copy to clipboard operation
lite-server copied to clipboard

Lite-server : how to integrate proxy.config information into bs-config.json

Open joannluo66 opened this issue 6 years ago • 4 comments

This is a question rather than an issue.

I am developing a client application using Lite-server. In order to access the backend API I need to set up the proxy config so I don't run into the CORS issue. I have a bs-config.json that has port and server information set up. I want to know how I can integrate the prox-config information into the bs-config.json. Do I really need to create a separate bs.config.js? Or should I somehow pass into two config files the commands in the package.json where I have "lite-server -c bs.config.json"? Thanks a lot! Below is a sample proxy.conf.json file but I am using Lite-server so I don't see a way to pass in this configuration in the package.json.

{ "/api": { "target": "http://npmjs.org", "secure": false, "pathRewrite": { "^/api": "" }, "changeOrigin": true } }

joannluo66 avatar Feb 04 '20 19:02 joannluo66

upppppp

sechouaya avatar Feb 06 '20 13:02 sechouaya

upppppppppp

sechouaya avatar Feb 06 '20 13:02 sechouaya

uppppppppppppppppp

sechouaya avatar Feb 06 '20 13:02 sechouaya

https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/servers.md#lite-server

ytilis avatar Mar 02 '20 22:03 ytilis