All files / src/controllers/components estibotIntegrations.ts

80% Statements 8/10
50% Branches 2/4
66.66% Functions 2/3
77.77% Lines 7/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151x 1x   1x 2x 2x 2x 2x              
import axios from "axios";
let EstibotAPIKEY = process.env.EstibotAPIKEY || "gGIhNpU7xhdrFUXDKOb0D7sSA"
 
export const estibotApprasisalDetails = async (domainName: string) => {
  let url = `https://www.estibot.com/api?k=${EstibotAPIKEY}&a=appraise&d=` + domainName
  return await axios.get(url).then(res => {
    let response = res['data']
    return response
  }).catch(err => {
    // console.log(err)
    let errorMessage = err.error ? err.error.message : err
    throw {error: errorMessage, methodName: estibotApprasisalDetails.name}
  })
}