[annotator-dev] Trouble setting up local storage
Gareth Highnam
gareth862 at gmail.com
Mon Mar 9 21:09:29 UTC 2015
I've been tying to set up local storage with the storage plugin, using
Node.js+MongoDB. My end goal is for anyone visiting my page to be able to
annotate it and view any existing annotations previously made, when the
page loads. I don't need any authentication for this purpose.
Disclaimer: (I am a noob)
Here is where I am:
1. Page loads, annotator can highlight, create, edit, delete comments on
front end.
2. Annotator POST can create entries in back end.
When I reload page, no stored annotations are brought up, despite existing
in backend. Here is the code for the storage set up:
var content = $('div').annotator();
content.annotator('addPlugin', 'Store', {
// The endpoint of the store on your server.
prefix: '
http://www.nofeveryone.com:3000/inline',
// Attach the uri of the current page to all annotations to
allow search.
annotationData: {
'uri': 'http://www.nofeveryone.com/anno/anno.html'
},
// This will perform a "search" action when the plugin loads.
Will
// request the last 20 annotations for the current url.
// eg.
/store/endpoint/search?limit=20&uri=http://this/document/only
loadFromSearch: {
'limit': 20,
'uri': 'http://www.nofeveryone.com/anno/anno.html'
},
urls: {
search: '/search'
}
});
The API endpoints appear fully functional. When I test the same http
requests from my URI using curl, I get my posts back in JSON.
I've been pretty stumped for why it's not loading them with
"loadFromSearch", so if anyone thinks they can help I would greatly
appreciate it. I'm happy to give any other info about my code.
Gareth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150309/4317fa87/attachment-0003.html>
More information about the annotator-dev
mailing list