Skip to content

Instantly share code, notes, and snippets.

@obliviusm
Created October 19, 2018 14:10
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 obliviusm/33181f6a9db1cb0801db87f8a04fa04a to your computer and use it in GitHub Desktop.
Save obliviusm/33181f6a9db1cb0801db87f8a04fa04a to your computer and use it in GitHub Desktop.
import apisauce from 'apisauce'
const create = () => {
const api = apisauce.create({
baseURL: 'https://lyoutube-api-master.herokuapp.com/api/v1',
timeout: 20000,
responseType: 'json',
})
const getVideos = () => {
return api.get('/videos')
}
const getVideo = videoId => {
return api.get(`/videos/${videoId}`)
}
return {
getVideos,
getVideo,
}
}
export default create()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment