How to implement a client to server connection that is secure and syncs
Clash Royale CLAN TAG #URR8PPP How to implement a client to server connection that is secure and syncs I’m struggling to understand how the pouchDB interactions should be implemented. Say I want an offline-first app with syncing and auth, would I need to implement a middleman such as a node server to ensure my credentials to my main server are protected as having a PouchDB on the client with new PouchDB(‘name’, ‘https://username:password@server/dbname’) my creds to my main database are exposed. Would it be better to connect to a node server and that decide wether or not to allow access? How would this be done? Can I handle a direct connection to the server with auth and it be secure? Or is a middle man needed to ensure security. If a middle man is needed will you need to implement a sort of api i.e //client const db = new Pouch('days') db.sync(remote) //server app.get('/db/days', (res, req) => // do some pouch stuff for each db) https://github.com/pouchdb-community/p...