"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _axios = _interopRequireDefault(require("axios"));

var _index = _interopRequireDefault(require("./constants/index"));

var getHeader = function getHeader() {
  var jwt = localStorage.getItem('jwt') || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNjczMjgzOTMxLCJleHAiOjE2NzU4NzU5MzF9.FneBdHM5wMonyop7ZKwuOFprjvkT9KCeMXXvxWT7ZJo';
  var header = {
    'Content-type': 'application/json'
  };
  if (jwt) header.Authorization = "Bearer ".concat(jwt);
  return header;
};

var http = function http() {
  return _axios["default"].create({
    baseURL: _index["default"].STRAPI_URL,
    headers: getHeader()
  });
};

var _default = http;
exports["default"] = _default;