Sdk Client to http calls on manga server project
import { HttpManga } from "manga-js-http-sdk"
const httpManga = new HttpManga("http://localhost:80");
httpManga.set("your.path.here", { yourValueHere: true, anything:[1,2,3]}).then((r)=>{
console.log(r);
});
It just works if the server is setted to use garbage collector USE_TEMP_DATA=true
on server env
const timeoutInSecconds = 3;
//after 3 secconds server execute delete to your.path.here
httpManga.set("your.path.here", { yourValueHere: true, anything:[1,2,3]}, timeoutInSecconds).then((r)=>{
console.log(r);
});
httpManga.get("your.path.here").then((r)=>{
console.log(r);//here he value saved on your.path.here
});
httpManga.reset("your.path.here", { yourValueHere: true, anything:[1,2,3]}).then((r)=>{
console.log(r);
});
It just works if the server is setted to use garbage collector USE_TEMP_DATA=true
on server env
const timeoutInSecconds = 3;
//after 3 secconds server execute delete to your.path.here
httpManga.reset("your.path.here", { yourValueHere: true, anything:[1,2,3]}, timeoutInSecconds ).then((r)=>{
console.log(r);
});
httpManga.delete("your.path.here").then((r)=>{
console.log(r);
});
httpManga.clear().then((r)=>{
console.log(r);//there is no more data on server
});