wstorage
v0.2.1
Published
Just a simple web storage service and package.
Downloads
2
Maintainers
Readme
web-storage
Just a simple web storage service and package.
Usage
- Insert a simple document.
POST
${SERVICE}/family
{ "parents": { "father": { "name": "Gates" } } }
Done
- Load saved document.
GET
${SERVICE}/family
{ "parents": { "father": { "name": "Gates" } } }
- Update saved document's sub-document.
POST
${SERVICE}/family.parents.mother
{ "name": "Jobs" }
Done
--
GET
${SERVICE}/family
{ "parents": { "father": { "name": "Gates" }, "mother": { "name": "Jobs" } } }
- Parallel load documents.
GET
${SERVICE}/family.parents.mother,family.parents.father,dummy
[ { "name": "Jobs" }, { "name": "Gates" }, null ]
- Cross domain loading.
JSONP is also supported for loading. The callback name is $cb
, and can be overrided by environment parameter JSONP_CB
.
Example for jQuery:
$.ajax({ url: '${SERVICE}/${RESOURCE}', dataType: 'jsonp', jsonp: 'cb' }) .success(data => alert(data)); // get √
Install
nvm install
npm install
Run
npm start
Develop
npm run dev