Skip to main content

BootstrapWorker

bootstrapWorker

Bootstraps a Vendure worker. Resolves to a VendureWorker object containing a reference to the underlying NestJs standalone application as well as convenience methods for starting the job queue and health check server.

Read more about the Vendure Worker.

Example

import { bootstrapWorker } from '@vendure/core';
import { config } from './vendure-config';

bootstrapWorker(config)
.then(worker => worker.startJobQueue())
.then(worker => worker.startHealthCheckServer({ port: 3020 }))
.catch(err => {
console.log(err);
process.exit(1);
});
Signature
function bootstrapWorker(userConfig: Partial<VendureConfig>, options?: BootstrapWorkerOptions): Promise<VendureWorker>

Parameters

userConfig

parameter
Partial<VendureConfig>

options

BootstrapWorkerOptions

Additional options that can be used to configure the bootstrap process of the Vendure worker.

Signature
interface BootstrapWorkerOptions {
nestApplicationContextOptions: NestApplicationContextOptions;
}

nestApplicationContextOptions

property
NestApplicationContextOptions

These options get passed directly to the NestFactory.createApplicationContext method.