1.5.2 • Published 2 years ago

ssb-fetch v1.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

developing with insomnia / postman

Since insomnia and postman can't fetch ssb urls, we get around that by proxying through http.

npm run proxy

To run on a testnet set the ssb_appname env var as usual (defaults to ssb at ~/.ssb) before running proxy.

export ssb_appname=ssb-test

Creates an http server at http://locahost:4080

In insomnia you can either: http://locahost:4080/ssb://xxx=== or set a base url in your environment:

{
  "base_url": "http://localhost:4080/"
}

And then use {{ _.base_url }}ssb://xxx===

If you have a raw sigil id from the database you'll need to convert it to an ssb url. Simplest way is to paste it into the agregore omnibox where it's automatically converted for you. Or programmatically use ssb-uri2 from npm.

readme driven development below (work in progress)

GET is implemented for blobs and json messages; what to do about publishing?

I would prefer to use:

  • PUT for uploading blobs
  • PUT for new posts (have no root or branch)
    • check hash of author,type,content,timestamp-within-range for idempotency?
  • POST for replies (root, branch etc) because they can't be truly idempotent; because of the tangle?
  • DELETE for removing blobs from local store
  • DELETE for tombstoning messages

All the browsers that matter are supporting get, put, post, delete using fetch

html5 forms only support get and post

Would be nice to support html forms so that @cel could potentially use it as per his patchfoo client. What happens currently in agregore when submitting a form?

<form action="" method="get">... name & email inputs</form>

<!-- ?name=bob&email=bob%40bob.com appended to url -->
<form action="" method="post">... name & email inputs</form>

<!-- Content-Type: application/x-www-form-urlencoded -->
<!-- name=bob&email=bob%40bob.com -->

querying by url

querystring api

patchfox, oasis, and patchfoo all seem to have their own ways so that's a good excuse to invent a new standard!

there's always a relevant xkcd!

1.4.5

2 years ago

1.4.4

2 years ago

1.5.2

2 years ago

1.4.3

2 years ago

1.5.1

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.5

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago