Tapir is a messaging application meant to be used for synchronizing tasks across machines.
CoffeeScript JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
public
.gitignore
Procfile
README.md
package.json
server.js

README.md

Tapir

Tapir is a messaging application meant to be used for synchronizing tasks across machines. It uses Server Sent Events as the message protocol.

Installation

Install with npm

npm install -g node-tapir

Client

The client handles two commands (--cmd), send and listen. If you listen for a topic you will be notified every time a message is sent to your topic.

tapir --cmd listen

# Open a connection to the server that listens for `send`s on the topic
# .../roman-numerals-kata, run git pull when a message arrives
tapir --cmd listen 'https://github.com/andersjanmyr/roman-numerals-kata' \
  --script 'git pull'

tapir --cmd send

# Send a message (ping) to the topic .../roman-numerals-kata
# tapir --cmd defaults to send so there is no need to write --cmd send
tapir 'https://github.com/andersjanmyr/roman-numerals-kata'

tapir --help

Usage: tapir [options] [topic] [message]
   --host: The host, default: tapir-server.herokuapp.com
    --port: The port, default: 80
    --cmd: Command (send or listen), default: send
    --help: Prints this message
    --script: Run this command when a message arrives
    --verbose: Log some output
    topic: The topic you are interested int, defaults: topic
    message: The message, defaults: ping  --host: The host, default: tapir-server.herokuapp.com

Accessing a local server

If you want to run a server locally you can access with the options --host and --port.

# Send a ping to a local server
tapir --host localhost --port 3000 my-local-topic

Server

There is a running server at http://tapir-server.herokuapp.com. The client defaults to this address so if you don't mind your messages being public you are good to go.

If you want to run a local server, the server is started with npm start and it starts a server on process.env.PORT or 3000 if PORT is not set.

Implementation