test cors
This commit is contained in:
parent
943865b2c1
commit
0d0e8a8a62
3 changed files with 27 additions and 17 deletions
20
src/App.js
20
src/App.js
|
|
@ -1,8 +1,18 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react'
|
||||||
import logo from './logo.svg';
|
import logo from './logo.svg'
|
||||||
import './App.css';
|
import './App.css'
|
||||||
|
|
||||||
class App extends Component {
|
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() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
|
|
@ -14,8 +24,8 @@ class App extends Component {
|
||||||
Using FaunaDB & netlify functions
|
Using FaunaDB & netlify functions
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default App;
|
export default App
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import React from 'react';
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom'
|
||||||
import App from './App';
|
import App from './App'
|
||||||
|
|
||||||
it('renders without crashing', () => {
|
it('renders without crashing', () => {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div')
|
||||||
ReactDOM.render(<App />, div);
|
ReactDOM.render(<App />, div)
|
||||||
ReactDOM.unmountComponentAtNode(div);
|
ReactDOM.unmountComponentAtNode(div)
|
||||||
});
|
})
|
||||||
|
|
|
||||||
10
src/index.js
10
src/index.js
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom'
|
||||||
import './index.css';
|
import './index.css'
|
||||||
import App from './App';
|
import App from './App'
|
||||||
|
|
||||||
ReactDOM.render(<App />, document.getElementById('root'));
|
ReactDOM.render(<App />, document.getElementById('root'))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue