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:
<script lang="ts">
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');
}
}
</script>
package.json:
"proxy": {
"/api": "http://localhost:9000/api"
},