Skip to content

Instantly share code, notes, and snippets.

@Gimcrack
Created November 10, 2017 08:21
Show Gist options
  • Save Gimcrack/081b34bc186b6b61fa98dcad8cce74d8 to your computer and use it in GitHub Desktop.
Save Gimcrack/081b34bc186b6b61fa98dcad8cce74d8 to your computer and use it in GitHub Desktop.
Api.js
export default {
prefix : 'api/v1/',
get(url, data) {
return axios.get( this.prefix + url, data )
},
post(url, data) {
return axios.post( this.prefix + url, data )
},
patch(url, data) {
return axios.patch( this.prefix + url, data )
},
put(url, data) {
return axios.put( this.prefix + url, data )
},
delete(url, data) {
return axios.delete( this.prefix + url, data )
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment