Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to sync data from ydn-db web app to backend server? #86

Closed
asicfr opened this issue Oct 19, 2015 · 2 comments
Closed

how to sync data from ydn-db web app to backend server? #86

asicfr opened this issue Oct 19, 2015 · 2 comments

Comments

@asicfr
Copy link

asicfr commented Oct 19, 2015

With ydn-dn, i want to automatically synchronise data from my web app with my REST back end.
I read the documentation and searched in examples but i cannot make it work.
https://yathit.github.io/ydn-db/synchronization.html
http://dev.yathit.com/api/ydn/db/schema.html#sync

I tried to define a schema with sync configuration like that :

var schema = {
stores: [ {
name: 'contact',
keyPath: 'id',
Sync: {
format: 'rest',
transport: service,
Options: {
baseUri: '/'
}
}
}
]
};
and created a function for transport :

var service = function(args) {
console.log("contact synch");
};
but my service function is never called.
I certainly misunderstood how YDN-db work, but i didn't found any example.

To complete, here is a jsfiddle : http://jsfiddle.net/asicfr/y7sL7b3j/

Thx for your help.

@asicfr
Copy link
Author

asicfr commented Oct 19, 2015

Cool, thx.

@yathit yathit closed this as completed Oct 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants