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

Express middleware #45

Closed
bredele opened this issue Mar 28, 2014 · 5 comments
Closed

Express middleware #45

bredele opened this issue Mar 28, 2014 · 5 comments
Labels
Milestone

Comments

@bredele
Copy link
Contributor

bredele commented Mar 28, 2014

Express accepts functions and/or express apps as middleware.

var app = require('express')();
app.use(function(){
});
app.use('/path', require('./otherapp'));

It's really useful to split an express app into smaller modules with single responsibilities. Feathers doesn't support it.

@bredele bredele added the bug label Mar 28, 2014
@bredele
Copy link
Contributor Author

bredele commented Mar 28, 2014

The problem is that we check if there is a get handler into the service:

use:function(location, service) {
...
 if (_.some(this.methods, hasServiceMethod)) {
      return this.service(location, service);
    }
...
}

A express app has always a get handler and feathers thinks it's a service.

@bredele
Copy link
Contributor Author

bredele commented Mar 28, 2014

An express app is an instance of Object (no function constructor) and doesn't expose any type, package name or version. The only way I see to know if that's an express app is to look for specific handlers (might be defaultConfiguration, propfind, etc).

@daffl daffl modified the milestones: 0.4.0, 0.3.2 Mar 28, 2014
@daffl
Copy link
Member

daffl commented Mar 28, 2014

Closed via #46

@daffl daffl closed this as completed Mar 28, 2014
@bredele
Copy link
Contributor Author

bredele commented Mar 28, 2014

Thanks :)

daffl added a commit that referenced this issue Aug 19, 2018
* Allow to pass an object to hook object

* Remove yarn.lock

* Fix assert
daffl pushed a commit that referenced this issue Aug 21, 2018
* fixing typo in test

* adding not-found handler
daffl added a commit that referenced this issue Aug 21, 2018
* Allow to pass an object to hook object

* Remove yarn.lock

* Fix assert
daffl pushed a commit that referenced this issue Aug 21, 2018
* fixing typo in test

* adding not-found handler
daffl pushed a commit that referenced this issue Aug 25, 2018
Adds middleware generator and automatic inclusion of auth hooks.
@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
Projects
None yet
Development

No branches or pull requests

2 participants