Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace Support #8

Closed
coreybutler opened this issue Aug 14, 2013 · 1 comment
Closed

Namespace Support #8

coreybutler opened this issue Aug 14, 2013 · 1 comment

Comments

@coreybutler
Copy link

I recently tried to expose a module that looked a bit like:

module.exports = {
  user: {
    get: function(id){...},
    remove: function(id){...},
  },
  users: {
    get: function(){... return all ...},
  }
};

I'm actually using a wrapper around the client call that allows me to reference methods like:

myclient.user.get(123,function(data){
  console.log('Got user',data);
});

Anyhow, this is more of a feature request. I'd like the ability to namespace my modules as shown above. The work is already done (see below).

@visionmedia - I don't know if this fits in with your vision of axon-rpc or not. It shouldn't affect current functionality, but I wasn't able to run the tests (they failed on a raw clone of the repo, i.e. before I made any changes). Anyhow, I setup a PR with my additions. It's yours for the taking. Either way, I personally have a need for this functionality via npm. I have no problem publishing it separately, but if you end up keeping it, let me know so I don't needlessly duplicate a module. npm has enough clutter already.

@coreybutler
Copy link
Author

I ended up making a lot of changes to this and mistakenly pushed them to the PR. So, I backed out the PR and am closing this. I've implemented the changes in lib/server.js on SHA c7fe5e6. I needed the updates in an npm module, so it is now up as ngn-axon-rpc and it's available at nodengn/ngn-axon-rpc for anyone interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant