Created
October 19, 2018 14:10
-
-
Save obliviusm/33181f6a9db1cb0801db87f8a04fa04a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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