test cors

This commit is contained in:
davidwells 2018-06-11 17:19:14 -07:00
parent 943865b2c1
commit 0d0e8a8a62
3 changed files with 27 additions and 17 deletions

View file

@ -1,8 +1,18 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import React, { Component } from 'react'
import logo from './logo.svg'
import './App.css'
class App extends Component {
componentDidMount() {
console.log('fetch items')
fetch('https://adoring-clarke-f30908.netlify.com/.netlify/functions/todos-read-all')
.then((response) => {
return response.json()
})
.then((myJson) => {
console.log(myJson)
})
}
render() {
return (
<div className="App">
@ -14,8 +24,8 @@ class App extends Component {
Using FaunaDB & netlify functions
</p>
</div>
);
)
}
}
export default App;
export default App

View file

@ -1,9 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
const div = document.createElement('div')
ReactDOM.render(<App />, div)
ReactDOM.unmountComponentAtNode(div)
})

View file

@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
ReactDOM.render(<App />, document.getElementById('root'));
ReactDOM.render(<App />, document.getElementById('root'))