"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getHeader = exports["default"] = void 0;
var _axios = _interopRequireDefault(require("axios"));
// import CONFIG from './constants/index';
var getHeader = exports.getHeader = function getHeader() {
  var jwt = localStorage.getItem('jwt');
  var header = {
    'Content-type': 'application/json'
  };
  if (jwt) header.Authorization = "Bearer ".concat(jwt);
  return header;
};
var http = function http() {
  return _axios["default"].create({
    baseURL: "".concat(process.env.REACT_APP_BACKEND_URL, "/api"),
    //CONFIG.STRAPI_URL, 'http://localhost/strapi/api',///

    headers: getHeader()
  });
};
var _default = exports["default"] = http;