import axios from 'axios';
import { API_URL, APP_VERSION } from '../constants';
import { Platform } from 'react-native';

export const request = axios.create({
  baseURL: API_URL
});

request.interceptors.request.use(config => {
  config.headers['App-Version'] = APP_VERSION;
  config.headers['Platform'] = Platform.OS;
  return config;
}, error => {
  return Promise.reject(error);
});
