-
-
Notifications
You must be signed in to change notification settings - Fork 751
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
Comments
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. |
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. |
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. |
* Capture propert stack trace and error messages * Fix typo
* Capture propert stack trace and error messages * Fix typo
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. |
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.
The text was updated successfully, but these errors were encountered: