horten-server

0.4.0 • Public • Published

Horten Server

horten-server is a batteries-included package to provide control and persistence for reactive, shared-state creative applications. It includes:

Example

Javascript

let server = new HortenServer()
 
// Configure the server.
server.configure( {
  listen: 8080,
  root: __dirname,
  persist: 'data/persist.yaml',
  verbose: true,
 
  // The page configuration is sent to horten-control.
  // Here is a very simple page with a single control.
  page: {
    content: {
      description: 'Choose a dwarf.',
      path: 'myDwarf/',
      options: [
        'Grumpy','Sleepy','Sneezy','Doc','Bashful','Dopey','Happy'
      ]
    }
  }
} )
 
// Open the server.
server.open()
 
// Use a Horten Cursor to listen to incoming changes from the server.
new H.Cursor( {
  listening: true,
  path: 'myDwarf/',
  onValue: ( value ) => console.log(`User chose ${value} as their dwarf. What's with that?`)
})
 

CLI

sudo npm install -g horten-server
 
horten-server \
  --http 8080 \
  --persist data/persist.yaml \
  --index yourControls.md \
  --require yourLogic.js

Readme

Keywords

none

Package Sidebar

Install

npm i horten-server

Weekly Downloads

2

Version

0.4.0

License

MIT

Unpacked Size

16 kB

Total Files

15

Last publish

Collaborators

  • koopero