0.0.17 • Published 6 years ago

shea v0.0.17

Weekly downloads
19
License
ISC
Repository
-
Last release
6 years ago

Shea

Shea is a simple tool for building and deploying UIs for Lotion applications.

Installation

Shea requires node v7.6.0 or higher.

$ npm install shea

Usage

  1. Write up some html to use as your Lotion app's client.

public/client.html:

<html>
<head>
  <title>my cool app</title>
</head>
<body>
  <p>hello decentralized world</p>
  <script>
    function sendTx(tx) {
      // http post tx to '/txs' to submit it to the blockchain
    }
    function getState() {
      // http get '/state' to get latest blockchain state
    }
  </script>
</body>
</html>
  1. Attach it to a Lotion app.

app.js:

let lotion = require('lotion')
let shea = require('shea')

let app = lotion({ initialState: {} })

app.use(shea('public/'))

app.listen(3000).then(appInfo => {
  console.log(appInfo.GCI)
  // 'f6d671670ce307f71164c7e9b7c1d89c0cf5a6456ddf0a538d59bdbd33216ec5'
})
  1. Run node app.js.

  2. Now clients, on any computer in the world, can run this to connect to your blockchain and open client.html in their browser:

$ npm i -g shea
$ shea <GCI>

That's it!

License

MIT

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago