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

How do I use basePath? #217

Closed
softbrix opened this issue Jan 19, 2021 · 5 comments
Closed

How do I use basePath? #217

softbrix opened this issue Jan 19, 2021 · 5 comments

Comments

@softbrix
Copy link
Contributor

softbrix commented Jan 19, 2021

I would like to host the bull-board as an admin addon to one of my image services.

I works fine when I'm on localhost ie. http://localhost:3000/queuestatus.
But on my server the app is hosted under a sub path: https://<server_name>/<application_name>/queuestatus.
I've seen a basePath variable in the code but no documentation on how to configure it.
Now the bull-board app fails to load the css and js files from the server because it tries to load them from https://<server_name>/queuestatus/...

I would like to see some documentation/example on how to use the basePath variable.

Thanks in advance.
/Andreas

@felixmosh
Copy link
Owner

#131 (comment)
Is it helps?

@softbrix
Copy link
Contributor Author

softbrix commented Jan 20, 2021

Works great with a little tweak:

const { router } = require('bull-board');

// ... express server code and a definition of basePath

app.use(
  '/admin/queuestat',
  (req, res, next) => {
    req.proxyUrl = basePath + 'admin/queues';
    next();
  },
  router
);

@felixmosh
Copy link
Owner

Can you make a PR for the readme, so future you will find it quickly? :]

@softbrix
Copy link
Contributor Author

Yes, I'll try to fix that.

@softbrix softbrix reopened this Jan 20, 2021
softbrix added a commit to softbrix/bull-board that referenced this issue Jan 20, 2021
Added documentation how to configure basePath in the Readme.md
@aakarsh-shekhar
Copy link

Is there a way to do this when using the @bull-board/nestjs package? I can't seem to find a solution for it other than configuring a middleware to serve the static resources on a customized path.

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

No branches or pull requests

3 participants