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
parameter
BootstrapWorkerOptions
Additional options that can be used to configure the bootstrap process of the Vendure worker.
Signature
interface BootstrapWorkerOptions {
nestApplicationContextOptions?: NestApplicationContextOptions;
ignoreCompatibilityErrorsForPlugins?: Array<DynamicModule | Type<any>>;
}
nestApplicationContextOptions
property
NestApplicationContextOptions
These options get passed directly to the NestFactory.createApplicationContext
method.
ignoreCompatibilityErrorsForPlugins
property
v3.1.0
Array<DynamicModule | Type<any>>
default:
[]
See the ignoreCompatibilityErrorsForPlugins
option in BootstrapOptions.