This repository has been archived on 2025-05-09. You can view files and clone it, but cannot push or open issues or pull requests.
EvoCalculator/src/index.tsx
Владислав Чикалкин 47660d8483 fix dev access
2020-09-24 13:31:44 +03:00

27 lines
803 B
TypeScript

import axios from 'axios';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './client/App';
import './index.css';
import * as serviceWorker from './client/serviceWorker';
import { API_PORT } from './core/constants/urls';
const isDevelopmentMode = process.env.NODE_ENV === 'development';
if (isDevelopmentMode) {
console.log(window.location);
axios.defaults.baseURL = `http://${window.location.hostname}:${API_PORT}`;
}
ReactDOM.render(
// <React.StrictMode>
<App />,
// </React.StrictMode>
document.getElementById('root'),
);
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();