5 ms·
This is pretty cool -- it's like a mini-ElasticSearch (and of course I'm overstating): $ npm install -g phant $ phant $ telnet localhost 8081
by pit 12y ago
This is pretty cool -- it's like a mini-ElasticSearch (and of course I'm overstating):
$ npm install -g phant
$ phant
$ telnet localhost 8081
phant> create
Enter a title> library
Enter a description> a bunch of books
Enter fields (comma separated)> title,author
Enter tags (comma separated)> paper,cloth
Stream created!
PUBLIC KEY: yrDmwO3XZEF6vMajz9oVTwPYVNM
PRIVATE KEY: NYzxmKOdl8tEQ0Bn2d3WhXLbn2O
DELETE KEY: WxpPb29VEkuyAemL8za2INraDPb
$ curl "http://localhost:8080/input/yrDmwO3XZEF6vMajz9oVTwPYVNM.json" -H 'Content-Type: application/json' -d '{"title": "The Book of Virtues", "author": "William J. Bennett"}' -H 'Phant-Private-Key: NYzxmKOdl8tEQ0Bn2d3WhXLbn2O'
$ curl "http://localhost:8080/output/yrDmwO3XZEF6vMajz9oVTwPYVNM.json"
[{"author":"William J. Bennett","timestamp":"2014-07-10T18:07:13.964Z","title":"The Book of Virtues"}]
- tdicola 12y agoYou should edit out those public and private keys.
- pit 12y agoWhy? I belieb that those keys are unique to the stream (which I don't really care about).
- tdicola 12y agoSorry didn't see it was just a local instance you were running so it probably doesn't matter. In general I wouldn't let your public and private keys get out because anyone could start writing, deleting, etc. with those keys.
- mrkrwtsn 12y agoObviously.
- stronglikedan 12y agoNot obvious to everyone. HN is a place for people to learn, as well as discuss.
- tlrobinson 12y agohttps://github.com/search?q=extension%3Akey+BEGIN+RSA+PRIVATE+KEY&type=Code&ref=searchresults https://github.com/search?q=extension%3Akey+BEGIN+RSA+PRIVAT...
- pit 12y agoThanks for looking out for me, though! One can never be too careful.