vue-pouch
vue-pouch copied to clipboard
Remote server usage
Hello, can you provide example with remote server, please.. following the example throws this error
Uncaught TypeError: defaultDB.signup is not a function
at Object.createUser (eval at <anonymous> (app.js:1920), <anonymous>:58:21)
at click (eval at 204 (0.1ec1d0a….js:28), <anonymous>:28:20)
at HTMLButtonElement.invoker (eval at <anonymous> (app.js:863), <anonymous>:1734:18)
Pouch.plugin(PouchFind)
Pouch.plugin(PouchLiveFind)
Pouch.plugin(PouchAuthentication)
Vue.use(VuePouch, {
pouch: Pouch,
defaultDB: 'http://localhost:5984/boom',
defaultUsername: 'super',
defaultPassword: 'm45ter'
})
<div class="credentials">
<button v-if="$pouch.hasAuth" @click="$pouch.resetAuth()">Reset Authentication</button>
<button v-else @click="$pouch.useAuth('myname', 'mypassword')">Authenticate</button>
<button @click="$pouch.createUser('myname', 'mypassword')">Create User</button>
Your remote session name: {{ $pouch.session.name }}
<div class="error" v-if="$pouch.authError">There was an error: {{ $pouch.authError }}</div>
</div>