strongloop/strong-remoting — pull request #44 by ritch (2014-02-13 02:53:17+00:00)
Title: RFC: Initial Approach => JavaScript (node + browser) Client

### RFC Initial Approach

This is just the initial approach. **Do not merge!**

**Re-using RemoteObject class on client and server**

The tests should make this pretty clear. We are re-using the building blocks of strong-remoting to create the mirror api to `handler()` => `RemoteObjects#invoke()`.

The non-trivial parts of `invoke()` are mapping argument values to an `HttpRequest` and a `methodString` to the correct `accepts` / `returns` meta-data. This approach makes these fairly trivial. This is because `RemoteObjects` can easily map `methodString` to a `RemoteMethod` and mapping arguments to a request is the same algorithm in `HttpContext` but instead of building a set of arguments from a request we are doing the reverse.