1const axios = require('axios');
2const apiEndpoint = 'https://xxxxxx.execute-api.us-east-1.amazonaws.com/dev/api/docs';
3
4const getDocs = async() => {
5 const data = await axios.get(apiEndpoint)
6 .then((res) => {
7 return res.data;
8 })
9 .catch((error) => {
10 return [];
11 })
12 return data;
13}
14
15getDocs()
16 .then(res=>{
17 console.log(res)
18 })Created on 1/30/2019