johnpapa / johnpapa/lite-server

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

Open
#170 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.3k
Forks
262
PR merge metrics
No merged PRs in 30d

Description

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
}
}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.