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

global prefix doesn't work #607

Closed
codeweb05 opened this issue Jul 14, 2023 · 12 comments · Fixed by #704
Closed

global prefix doesn't work #607

codeweb05 opened this issue Jul 14, 2023 · 12 comments · Fixed by #704
Labels

Comments

@codeweb05
Copy link

if I set global prefix on the api, the bull board ui doesn't work

app.setGlobalPrefix('api')

Screenshot from 2023-07-14 16-39-52

@Kirkify
Copy link

Kirkify commented Jul 14, 2023

Had a similar problem, but this was fixed in version 5.5.2 (See this PR) Follow this example here. When he sets the base path of the server adapter here Line 58. Update it with your base path (so if it's 'api' like you wrote above then /api/queues and it should work.

Or another way is just modify your app.setGlobalPrefix to have a slash in front so app.setGlobalPrefix('/api') in your case.

@VaZark
Copy link

VaZark commented Jul 19, 2023

I'm using the with-nestjs-module example.

Is it not possible to use the routes & boardOptions in the BullBoardModule.forRoot params along with the global prefix instead of creating a separate module just for config?

going through the package, this line, implies that global prefix is respected but I get the same loading error too :(

I just missed an "s"

@felixmosh
Copy link
Owner

@codeweb05 does @Kirkify response solved your issue?

@felixmosh
Copy link
Owner

@codeweb05, does #639 solves your issue?

@henrysachs
Copy link

this issue is still present for me today. I just set the / beforeapi and now it works :)

@NatashkinAlex
Copy link

NatashkinAlex commented Dec 18, 2023

I have some problem( I use @bull-board/nestjs with fastify

@vvtri
Copy link

vvtri commented Jan 4, 2024

I'm using the with-nestjs-module example.

Is it not possible to use the routes & boardOptions in the BullBoardModule.forRoot params along with the global prefix instead of creating a separate module just for config?

going through the package, this line, implies that global prefix is respected but I get the same loading error too :(

I just missed an "s"

I have the same problem when using nestjs with fastify adapter, global prefix and nestjs bull board module. Can you show me how you fix this ?

@selabie68
Copy link

I have this same issue when using fastify.

Adding / before api does not fix the issue for fastify, it might fix it for express only.

Seems related to this line where on the fastify adapter we are overriding the prefix option.

PR #639 does resolve the issue for me though.

@Ttou
Copy link
Contributor

Ttou commented Feb 1, 2024

have this same issue when using fastify.

my plan is using pnpm patch to modity the package.

This was referenced Mar 21, 2024
@felixmosh
Copy link
Owner

@codeweb05, can you check if #704 solves this issue?

@pvhuy84
Copy link

pvhuy84 commented Nov 25, 2024

Hi, I has an issue with exclude

this.app.setGlobalPrefix('api/v1', {
      exclude: [
        { path: 'health', method: RequestMethod.GET },
        { path: 'queues', method: RequestMethod.ALL },
      ],
    });

the page: localhost/queues still work but I don't get css, js be cause URL point to path localhost/api/v1/queues/static/js/33563.2599da75.js

@pvhuy84
Copy link

pvhuy84 commented Nov 25, 2024

It should be handle for exclude case

const addForwardSlash = (path: string) => {
      return path.startsWith('/') || path === '' ? path : `/${path}`;
    };
    const prefix = addForwardSlash(this.applicationConfig.getGlobalPrefix() + this.options.route);

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

Successfully merging a pull request may close this issue.

10 participants