https://github.com/josepedrodias/logger
memory key value store for remote debugging
https://github.com/josepedrodias/logger
debug javascript key-value-store kiss remote-debug
Last synced: 3 months ago
JSON representation
memory key value store for remote debugging
- Host: GitHub
- URL: https://github.com/josepedrodias/logger
- Owner: JosePedroDias
- Created: 2018-05-22T16:52:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-15T12:47:18.000Z (about 6 years ago)
- Last Synced: 2025-01-21T09:48:26.697Z (5 months ago)
- Topics: debug, javascript, key-value-store, kiss, remote-debug
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# logger
basic key value store without auth. has a getter and setter for different keys and a wait which will long poll for changes on root.
the server is a very basic express server (which also serves the client code for convenience).
## server endpoints
`GET /:key?` - returns the value of the whole store or just for a given key
`POST /:key` (JSON body is the value to set) - sets the value for the key
`GET /wait/:key?` - returns once key changes (if provided) or any key changes (of no key is passed)
`GET /client.js` - the browser client is served here for convenience
## client JS API
import the client via script tag or module.
```javascript
const L = logger('http://127.0.0.1:3000');L.set(k, v).then(noop);
L.get(k).then((o) => console.log(o));
L.onChange(onDataCb, onErrorCb, optionalKey);
```