0.1.1 • Published 10 years ago

linejs v0.1.1

Weekly downloads
11
License
-
Repository
github
Last release
10 years ago

Line Logo

$ npm install -g linejs && line

About

npm version

Line is all about...

Getting Started

At the moment (v0.1.0) Line is a thin command-line wrapper around the nightlife-rabbit WAMP router developed by . It enforces the standalone requirement of the WAMP specification by encapsulating the logic into a lightweight command line tool to run a standalone NodeJS WAMP router. As such, to run the router, simply run the line command:

$ line

And it will fire up a simple WAMP router. There are presently three configurable options as follows (you can access this by running line -h):

Options:

    -h, --help          output usage information
    -v, --version       output the version number
    -p, --port [value]  The port the router will listen on (defaults to 3131)
    -P, --path [value]  The path of the websocket connection (defaults to /line)
    -o, --autoOff       Disable auto realm creation if the realm does not exist (defaults to false)

FAQ

Is LineJS a Node.js WAMP router?

No, LineJS does not try to be a WAMP router and neither should it be used as such. LineJS is a framework or template to be used and configured to build next generation realtime web APIs to replace RESTful HTTP APIs.

Why isn't LineJS a WAMP router?

Because that's not what it is. There already exist several open source WAMP routers including the officially supported Crossbar.io project which can run NodeJS application logic.

If LineJS isn't a WAMP router how can it use WAMP?

This question is usually asked because of a fundemental misunderstanding of WAMP. WAMP is a protocol, just like HTTP. And it can be used in many different ways. For example, REST (REpresentational State Transport) is a way to use HTTP. But one could just as easily use the HTTP protocol in ways that would violate RESTful principles. In much the same way, WAMP functions as a subprotocl based on websockets. Unfortunately, the WAMP spec includes one opiniated requirement that systems using WAMP should always use routers. We believe this is a fundemtal flaw in the WAMP spec since a communication spec should not worry about architecture. As a result, we've taken an approach very similar to existing HTTP APIs which combines the power and flexiblity of WAMP with the proven architecture of HTTP APIs and combined them to get LineJS. We like to think of it as a cross between generic HTTP APIs and WAMP. Or you could call it a hybrid WAMP solution.

So does that mean LineJS violates the WAMP protocl spec?

Yes, LineJS does violate the one requirement that those implementing the WAMP spec use routers. As a result, LineJS is NOT WAMP compliant. In all other aspects, however, LineJS does correctly implement the WAMP spec.