I have a Vue project from @vue/cli 3.x.
The proxy I defined in package.json based on this article is not working. The destination server doesn't see the API request.
What am I missing here?
The vue file:
import { Component, Prop, Vue } from 'vue-property-decorator';
import VueResource from 'vue-resource';
Vue.use(VueResource);
@Component
export default class HelloWorld extends Vue {
@Prop() private msg!: string;
constructor() {
super();
this.$http.post('/api');
}
}
package.json:
"proxy": {
"/api": "http://localhost:9000/api"
},
解决方案
The article likely refers to an outdated method of setting up the proxy. The latest version of @vue/cli (cur