From 6ab9deac1ab8eaf5b3179c5f9b424522dccbbcf0 Mon Sep 17 00:00:00 2001 From: Erastus Amunwe Date: Mon, 2 Nov 2020 09:48:10 +0200 Subject: [PATCH] added methods for communicating with the getbible api --- src/api/getbible_v2_api.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/api/getbible_v2_api.js diff --git a/src/api/getbible_v2_api.js b/src/api/getbible_v2_api.js new file mode 100644 index 0000000..fc703bd --- /dev/null +++ b/src/api/getbible_v2_api.js @@ -0,0 +1,15 @@ +// TO DO +// these should be imported from root config file + +let BASE_URL = 'https://getbible.net'; +let API_VERSION = 'v2'; + + +export default { + get_translations(){ + return fetch(`${BASE_URL}/${API_VERSION}/translations.json`) + }, + get_translation(abbreviation){ + return fetch(`${BASE_URL}/${API_VERSION}/${abbreviation}.json`) + } +} \ No newline at end of file