receive get and post requests in vue.js

I want to be able to receive and resond to get and post requests in my vue application. The template that I’m using is webpack-simple, and I want to be able to handle requests in the src>main.js file.

import App from './App.vue'

// incoming request
   // get request data
   // process data
   // send response

new Vue({
  el: '#app',
  render: h => h(Main)
})