Skip to content

Instantly share code, notes, and snippets.

@kuroski
Created September 11, 2018 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuroski/9252d7c2cc4613bdf35972ead5e1c41d to your computer and use it in GitHub Desktop.
Save kuroski/9252d7c2cc4613bdf35972ead5e1c41d to your computer and use it in GitHub Desktop.
import axios from 'axios'
import httpAdapter from 'axios/lib/adapters/http'
const instance = axios.create({
baseURL: 'https://api.github.com',
adapter: httpAdapter,
})
export default {
searchUser(username) {
return instance
.get(`/users/${username}`)
.then(result => result.data)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment