ssbc / patchwork

A decentralized messaging and sharing app built on top of Secure Scuttlebutt (SSB).
https://www.scuttlebutt.nz
GNU Affero General Public License v3.0
3.58k stars 333 forks source link

Insert the RPC manifest into the frontend #269

Closed pfrazee closed 8 years ago

pfrazee commented 8 years ago

Currently it's being duplicated by hand into ui/lib/ws-client.js, and it really ought to be inserted into the page at load-time.

pfrazee commented 8 years ago

In http-server.js, the ui/main.html file is served by the ServeApp function. You should be able to get the RPC manifest with sbot.getManifest(). By splicing that into main.html as a JSON, you'll be able to replace the manifest that's in ui/lib/ws-client.js

dominictarr commented 8 years ago

we did this before by putting the manifest in a separate script tag that set a global variable. which is nice because it doesn't require a build step.