1 |
c46ffe2f
|
plundrichov
|
import React from 'react';
|
2 |
|
|
import ReactDOM from 'react-dom';
|
3 |
|
|
import './index.css';
|
4 |
|
|
import App from './App';
|
5 |
|
|
import * as serviceWorker from './serviceWorker';
|
6 |
faed7f5e
|
plundrichov
|
|
7 |
1865a0be
|
Pavel Fidransky
|
fetch('config.json')
|
8 |
|
|
.then((response) => {
|
9 |
|
|
if (response.ok) {
|
10 |
|
|
return response.json();
|
11 |
|
|
} else {
|
12 |
|
|
throw new Error('Couldn\'t fetch config.json!');
|
13 |
|
|
}
|
14 |
|
|
})
|
15 |
|
|
.then(config => {
|
16 |
faed7f5e
|
plundrichov
|
window.config = config;
|
17 |
1865a0be
|
Pavel Fidransky
|
|
18 |
faed7f5e
|
plundrichov
|
ReactDOM.render(
|
19 |
|
|
<React.StrictMode>
|
20 |
|
|
<App />
|
21 |
|
|
</React.StrictMode>,
|
22 |
1865a0be
|
Pavel Fidransky
|
document.getElementById('root'),
|
23 |
faed7f5e
|
plundrichov
|
);
|
24 |
1865a0be
|
Pavel Fidransky
|
})
|
25 |
|
|
.catch(reason => {
|
26 |
|
|
console.error(reason);
|
27 |
faed7f5e
|
plundrichov
|
});
|
28 |
|
|
|
29 |
c46ffe2f
|
plundrichov
|
// If you want your app to work offline and load faster, you can change
|
30 |
|
|
// unregister() to register() below. Note this comes with some pitfalls.
|
31 |
|
|
// Learn more about service workers: https://bit.ly/CRA-PWA
|
32 |
|
|
serviceWorker.unregister();
|