我在资产文件夹中使用一个 file.json 和我的后端地址 file.json
{
"api": "https://backend.com/api"
}
然后通过一个函数,我从 json 中获取值:
export const GET_API = function () {
return require('../assets/file.json').api;
};
但是当我通过值构建项目时ng build --prod
是静态的。
我正在寻找一种更改生产后端地址的方法