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

Dynamic services #82

Closed
grendo opened this issue Jun 14, 2014 · 4 comments · Fixed by #107
Closed

Dynamic services #82

grendo opened this issue Jun 14, 2014 · 4 comments · Fixed by #107
Milestone

Comments

@grendo
Copy link

grendo commented Jun 14, 2014

Hi,
like the library did not suit exactly what I wanted. I want exactly the realtime/rest interface you have but want to be able to set up services at runtime. As you are using app.use this is not possible this without restarting the server.

Not a bug but just a feature I would find useful.

@daffl
Copy link
Member

daffl commented Jun 14, 2014

This has been mentioned in #67 as well and #78 throws an error when trying to register services after the server has been started. The problem is not app.use (you can register middleware after the the app is running as far as I know) it's the socket providers that hook up the events for every registered service at startup.

It actually wouldn't be too hard to change that but it would be helpful to have an example use case.

@marshallswain
Copy link
Member

It has been on my todo list to look into this. Here's my use case:

I'd like to take the mongo-express project found here https://github.com/marshallswain/mongo-express and turn it into a CanJS-Feathers app, so document updates propagate automatically. I would basically pass it a list of mongo collections and set up a service for each one.

The API could probably be set up just like a "services" service, so you could POST {resource:"customers"} to set one up. (It would have to be a unique-enough endpoint name, since "services" is likely to be used by an app.) The resource name would become the id, so you could DELETE it by resource name. Hooks would be needed, just like a normal service, to set up access control.

I'd like to do it as a tutorial-style project - with lots of documentation on how it was built - to get more exposure to both CanJS and Feathers. I'm just starting to work on a CanJS version with no realtime support. I'll come back and look at this afterwards. I can just see this coming in very handy for building point-and-click CMS/admin interfaces.

As for the technical side, is it possible to add socket services during runtime with Primus and Socket.io? I've not looked into it.

@daffl
Copy link
Member

daffl commented Nov 23, 2014

A tutorial app would be awesome! At the moment it is unfortunately not possible to register services at runtime. Interestingly it's a feature that seems to be requested quite a bit. I will have to look into a good way of doing that.

@daffl daffl added this to the 1.1.0 milestone Feb 11, 2015
daffl added a commit that referenced this issue Aug 21, 2018
* Capture propert stack trace and error messages

* Fix typo
daffl added a commit that referenced this issue Aug 21, 2018
* Capture propert stack trace and error messages

* Fix typo
@lock
Copy link

lock bot commented Feb 8, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants