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

Web Interface Doesn't work properly (redirects to /active without hostname) #715

Closed
TylerBrock opened this issue Sep 22, 2015 · 20 comments
Closed

Comments

@TylerBrock
Copy link

Hey everyone, I've tried starting the web interface as described in the documentation:

var kue = require('kue');
kue.createQueue();
kue.app.listen(3000);

When the app runs and I visit "http://localhost:3000" in a browser it redirects to "/active" without the scheme and hostname portion of the URL. Manually entering back the scheme and hostname allows the /active page to render but without any assets or javascript.

I've tried loading the page in Chrome 45 and Safari (latest version) with the same result.

@behrad
Copy link
Collaborator

behrad commented Sep 23, 2015

which kue version @TylerBrock ?

@TylerBrock
Copy link
Author

0.9.5

On Sep 22, 2015, at 10:07 PM, Behrad notifications@github.com wrote:

which kue version @TylerBrock ?


Reply to this email directly or view it on GitHub.

@m2sh
Copy link

m2sh commented Sep 23, 2015

I have the same problem, but when using kue ui there is no problem & both UIs works fine.

@behrad
Copy link
Collaborator

behrad commented Sep 23, 2015

This should be caused by the latest commits to support for embedding kue inside other express apps. please check 447f525

@TylerBrock
Copy link
Author

That fixes it but for the simple use case I outline above (the hostname is now included) but it still doesn't respect the outer context with regards to where it's mounted.

For example I'm mounting the application at "/queue" but visiting localhost:3000/queue redirects to localhost:3000/active instead of localhost:3000/queue/active

@TylerBrock
Copy link
Author

It seems I can work around it by specifying a path when mounting kue in the sub-app by specifying app.use('/queue', app.kue) but it prevents it from being mounted somewhere besides /queue in the parent application.

Thanks for maintaining this btw. Great stuff.

@behrad
Copy link
Collaborator

behrad commented Sep 23, 2015

Any one can provide a more general PR to handle all scenarios?

@azimgd
Copy link
Contributor

azimgd commented Sep 25, 2015

Hi,
i was able to fix it. please take a look to PR.

@behrad
Copy link
Collaborator

behrad commented Sep 25, 2015

does this work for both express 3 and express 4 !?

@azimgd
Copy link
Contributor

azimgd commented Sep 25, 2015

I've tried with express 4 only, let me recheck with express 3 as well.

@azimgd
Copy link
Contributor

azimgd commented Sep 25, 2015

Redirection from subfolder is failing. on express 3

@behrad
Copy link
Collaborator

behrad commented Sep 25, 2015

I believe all two cases for both express versions (4 scenarios) should be considered to be fixed.
Thank you @azimgd

@azimgd
Copy link
Contributor

azimgd commented Sep 25, 2015

This fix tested both on express v3 and v4, redirection on root and subfolder is working now. Please review.

@behrad
Copy link
Collaborator

behrad commented Sep 25, 2015

nice @azimgd
Are you using kue-ui? Can you test that if does work too?

@azimgd
Copy link
Contributor

azimgd commented Sep 25, 2015

I had some troubles with running kue-ui itself, but setting it up as described in documentation and accessing kue interface via /api produces correct redirections.

hostname.dev/subfolder/api/ -> hostname.dev/subfolder/api/active
hostname.dev:3000/api/ -> hostname.dev:3000/api/active

@behrad
Copy link
Collaborator

behrad commented Sep 26, 2015

i will test and merge this in a few days @azimgd

@azimgd
Copy link
Contributor

azimgd commented Oct 1, 2015

Any updates on this @behrad ?

behrad added a commit that referenced this issue Oct 1, 2015
@behrad
Copy link
Collaborator

behrad commented Oct 1, 2015

tested and merged

@behrad behrad closed this as completed Oct 1, 2015
@maxcnunes
Copy link

Could you please publish a new version including this fix? Thanks.

@behrad
Copy link
Collaborator

behrad commented Oct 6, 2015

Done!

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

5 participants