1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/app.js
Tim Daubenschütz 909e9db0b8 add polyfill
2015-07-03 10:40:04 +02:00

37 lines
762 B
JavaScript

'use strict';
require("babel/polyfill");
import React from 'react';
import Router from 'react-router';
import fetch from 'isomorphic-fetch';
import ApiUrls from './constants/api_urls';
import routes from './routes';
import requests from './utils/requests';
let headers = {
'Accept': 'application/json',
'Content-Type': 'application/json'
};
requests.defaults({
urlMap: ApiUrls,
http: {
headers: headers,
credentials: 'include'
},
fatalErrorHandler: (err) => {
console.log(err);
//alert('Something went wrong, please reload the page');
}
});
Router.run(routes, Router.HistoryLocation, (AscribeApp) => {
React.render(
<AscribeApp />,
document.getElementById('main')
);
});