summaryrefslogtreecommitdiff
path: root/sample-apps/react-todo/src/index.js
blob: c03cc2c2572d7c2b4bfc94ddffa30c8ced5f6041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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'

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()