-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Problems with NX and NestJS in Production #347
Comments
Try to setup your bull-board like it was setup in here: |
i still receive the same error. |
Show some code pls :] |
async function bootstrap() {
const app = await NestFactory.create(AppModule, { bufferLogs: true });
app.connectMicroservice({
transport: Transport.GRPC,
options: {
package: 'grs',
protoPath: join(__dirname, 'grs/grs.proto'),
loader: { keepCase: true },
url: '0.0.0.0:50051'
}
});
const globalPrefix = 'api';
app.setGlobalPrefix(globalPrefix);
const port = process.env.PORT || 3333;
const logger = app.get<OgmaService>(OgmaService);
app.useLogger(logger);
app.enableShutdownHooks();
app.enableCors({ origin: '*' });
app.use(passport.initialize());
const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath('/admin/queues');
createBullBoard({
queues: [new BullAdapter(new Queue('scan_secrets'), { readOnlyMode: true })],
serverAdapter
});
app.use('/admin/queues', serverAdapter.getRouter());
const config = new DocumentBuilder()
.setTitle('GRS Api')
.setDescription('The Api for the main GRS component')
.setVersion('1.0')
.addBearerAuth()
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup(globalPrefix + '/swagger', app, document, {
swaggerOptions: {
persistAuthorization: true
},
customSiteTitle: 'Grs Api Docs'
});
await app.startAllMicroservices();
await app.listen(port, '0.0.0.0', () => {
logger.log('Listening at http://localhost:' + port + '/' + globalPrefix);
});
} But I think it could also be Loadbalancer related. |
The setup of |
What is weird for me is that the webui is loading but is stuck at 'loading...' because the api requests wont be served. |
what do you see in the console? |
@henrysachs I face that issue. Use serverAdapter.setBasePath('/api/admin/queues'); instead of serverAdapter.setBasePath('/admin/queues'); |
I'm closing it since it is not active, reopen if the issue doesn't solved |
Hey There I've integrated bull-board with nestjs and I'm using nx to manage my monorepo. I got this working locally with a NestJS Middlleware implementing Bull-Board and everthing seems fine. This is my Middleware:
But as soon as i'm deploying it to a Docker container the Api routes dont seem to register anymore i get the UI and so on but its Stuck on loading...
when opening the network tab i see requests unanswered and timing out.
these point to
https://MYDOMAIN/api/queues/api/queues?page=1
until then i noticed a bit of a weird path scheme but this works locally.
Any Idea how i could debug this further?
version:
"@bull-board/express": "^3.7.0",
The text was updated successfully, but these errors were encountered: