vue.js - 没有 vue-cli 的 vue 中 proxy.conf.json 的替代方案?
问题描述
我想在另一个网站上向 api 提出请求。
我知道在 Angular 中你可以有一个类似这样的文件 proxy.conf.json
{
"/api": {
"target": "website.com",
"secure": false,
"changeOrigin": true,
"logLevel": "debug"
}
}
如果我不使用 vue-cli,有没有办法在 vue 中做到这一点?
解决方案
最终使用带有 webpack 开发中间件的 express 服务器和express-http-proxy
推荐阅读
- typescript - 如何使用量角器一一选择下拉列表中的所有值
- html - (min-width: 1800px) 的媒体查询在 1800px 时不起作用?
- java - 在事务级别处理大型 csv 文件
- apache-spark - 保存 MLlib 模型时控制文件数
- python - 在 Python 2.7 中分配 styleObj 后,如何使用 sheet['A'].style/styleObj 分配样式?
- amazon-web-services - 如何在 .ebextensions 配置中为 crontab 多个环境使用条件(AWS Elastic Beanstalk)
- android - 响应改造时始终为空
- html - 如何在Outlook电子邮件中获取电子邮件地址
- javascript - Javascript函数重复旧调用,第二次调用时
- arrays - 使 int 数组的总和随着数组元素的变化而变化