diff options
Diffstat (limited to 'sample-apps/react-todo/src/index.js')
-rwxr-xr-x | sample-apps/react-todo/src/index.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sample-apps/react-todo/src/index.js b/sample-apps/react-todo/src/index.js index 0c5e75d..c03cc2c 100755 --- a/sample-apps/react-todo/src/index.js +++ b/sample-apps/react-todo/src/index.js @@ -1,12 +1,19 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; -import * as serviceWorker from './serviceWorker'; +import React from 'react' +import ReactDOM from 'react-dom' +import './index.css' +import App from './app' +import { dbFactory } from 'naive-client' +import * as serviceWorker from './serviceWorker' -ReactDOM.render(<App />, document.getElementById('root')); +const httpUrl = 'http://localhost:5000' +const wsUrl = 'ws://localhost:5001' +const db = dbFactory({ wsUrl, httpUrl }) + +db.init() + +ReactDOM.render(<App db={db} />, document.getElementById('root')) // If you want your app to work offline and load faster, you can change // unregister() to register() below. Note this comes with some pitfalls. // Learn more about service workers: http://bit.ly/CRA-PWA -serviceWorker.unregister(); +serviceWorker.unregister() |