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 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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
})
|
||||
|
|
|
|||
10
src/index.js
10
src/index.js
|
|
@ -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'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue