Skip to main content

Bootstrap

bootstrap

Bootstraps the Vendure server. This is the entry point to the application.

Example

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

bootstrap(config).catch(err => {
console.log(err);
process.exit(1);
});

Passing additional options

Since v2.2.0, you can pass additional options to the NestJs application via the options parameter. For example, to integrate with the Nest Devtools, you need to pass the snapshot option:

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

bootstrap(config, {
nestApplicationOptions: {
snapshot: true,
}
}).catch(err => {
console.log(err);
process.exit(1);
});
Signature
function bootstrap(userConfig: Partial<VendureConfig>, options?: BootstrapOptions): Promise<INestApplication>

Parameters

userConfig

parameter
Partial<VendureConfig>

options

BootstrapOptions

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

Signature
interface BootstrapOptions {
nestApplicationOptions: NestApplicationOptions;
}

nestApplicationOptions

property
NestApplicationOptions

These options get passed directly to the NestFactory.create() method.