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

Application redirects to /active when used as express middleware #592

Closed
endorama opened this issue Apr 25, 2015 · 14 comments
Closed

Application redirects to /active when used as express middleware #592

endorama opened this issue Apr 25, 2015 · 14 comments

Comments

@endorama
Copy link

As reported by @digitaljohn and me in #587.

Step to reproduce:

  • use kue app in a express application:

    var app = express();  
    
    app.use(kue.app);
    
    app.listen(3000);
    
  • try to reach http://localhost:3000

Expected behaviour:
Redirect to http://localhost:3000/active

Actual behaviour:
Redirected to http:///active/

Kue version: 8.1.2
Express version: 3.1.2
Npm version: 2.7.4
Node version: 0.12.2

@behrad
Copy link
Collaborator

behrad commented Apr 25, 2015

whats your kue version?

@endorama
Copy link
Author

8.1.2

@behrad
Copy link
Collaborator

behrad commented Apr 25, 2015

we have no 8.1.2 version, dya mean 0.8.12 ?

@behrad
Copy link
Collaborator

behrad commented Apr 25, 2015

if so, 0.8.12 is based on express 3.x and I don't think it can sit as a middleware in an express 4 app

@behrad
Copy link
Collaborator

behrad commented Apr 25, 2015

however I'm not an express man, so any patches are welcome if anybody can provide something to fix this

@endorama
Copy link
Author

Ups sorry :) yes is 0.8.12. I had a look at the code but is really simple, so the problem could be a little weird.

Hope to have time to look into this a bit more in the next weeks

@behrad
Copy link
Collaborator

behrad commented Apr 25, 2015

have you tested if the above code (express 4.x) works in kue 0.9.0 ?

@h2non
Copy link
Contributor

h2non commented Apr 26, 2015

I'm experimenting the same trouble. I'll take a look to the code

@h2non
Copy link
Contributor

h2non commented Apr 26, 2015

Seems like this is related to the Express version. In my case using 3.x, where the req object interface is not the same as expected with Express 4.x. The field baseUrl is missing in 3.x and old versions.

h2non added a commit to h2non/kue that referenced this issue Apr 26, 2015
@h2non
Copy link
Contributor

h2non commented Apr 26, 2015

I've created a PR that should fix this issue. #594

behrad added a commit that referenced this issue May 2, 2015
fix(#592): bad redirect URL in old express versions
@behrad
Copy link
Collaborator

behrad commented May 2, 2015

tested in 0.9.0, thank you @h2non

@behrad behrad closed this as completed May 2, 2015
@hellboy81
Copy link

I need to secure kue dashboard with password.

Other endpoints are authenticated by other methods.

I am trying as follows:

  var basicAuth  = require('basic-auth-connect')
  ....
   // Securing dashboard app
    var subApp = express()
    // add authentication
    subApp.use(basicAuth('foo', 'bar'))
    // re-add kue.app (but dont put it in its own folder)
    subApp.use('', messagesMod.kueDashboardApp)
    server.use('/kue', subApp)

@hellboy81
Copy link

If I call /kue endpoint, I got redirect to /kueactive

I am using kue with fixed bad redirect URL issue

@behrad
Copy link
Collaborator

behrad commented Jul 28, 2015

why not to use server.use('/kue/', subApp) ?

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

No branches or pull requests

4 participants