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

Service setup called before app.io instantiated #131

Closed
ianhaggerty opened this issue Apr 7, 2015 · 6 comments · Fixed by #132
Closed

Service setup called before app.io instantiated #131

ianhaggerty opened this issue Apr 7, 2015 · 6 comments · Fixed by #132
Milestone

Comments

@ianhaggerty
Copy link

I need access to io in an service setup() method. This is instantiated in the feathers.socketio() configuration function. However, testing seems to indicate that my services setup() method is being called before the socketio configuration function.

Here's my usage:

        testService = mongodb 'test'
        app
        .configure  feathers.rest()
        .configure  feathers.socketio (io)->
          debugger # this is called after `extendedTestService.setup()`
        .use bodyParser.json()
        .use '/test', extendedTestService
        .listen 3000
@daffl daffl added this to the 1.1.0 milestone Apr 8, 2015
@daffl
Copy link
Member

daffl commented Apr 8, 2015

I can confirm this. There is an easy fix with the only drawback that the service event handlers aren't set up in the configuration function but I don't think that would be an issue. I'll land the fix tonight and make a 1.1.0-pre.0 release that you can use.

daffl added a commit that referenced this issue Apr 10, 2015
Run Socket configurations before service setup (#131)
@daffl
Copy link
Member

daffl commented Apr 11, 2015

Sorry, took a little longer but the issue should be fixed in version 1.1.0-pre.0 which is available on NPM.

@ianhaggerty
Copy link
Author

Great! Thanks for the fix. Big fan of feathers (come from Sails JS), would be happy to contribute in future.
Oscar

@daffl
Copy link
Member

daffl commented Apr 11, 2015

Awesome! Any contributions are welcome :) I'd still be curious in a Feathers vs Sails comparison.

@ianhaggerty
Copy link
Author

Sails is annoyingly opinionated in my experience. It is difficult to manage middle-ware properly. Sails-Waterline (database ORM) is fairly limited & slow in trying to support so many databases. Feathers elegantly bridges the gap, is lightweight & easily customizable.

I am currently building a fresh mongodb service - one that supports query criteria such as limit etc, as well as mongodb aggregate commands. Been meaning to github repo it but it needs some polish in the mean time.

@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.

2 participants