@motech-development/bootstrap
v1.0.7
Published
Bootstrap NestJS REST API and microservice applications
Downloads
32
Readme
@motech-development/bootstrap
Bootstrap NestJS REST API and microservice applications
Quickly get a NestJS app up and running with built in network logging, input validation and application crash logging. Supports both Nest applications and microservices.
Installation
Add @motech-development/bootstrap
as a dependency.
# Yarn
yarn add @motech-development/bootstrap
# NPM
npm i @motech-development/bootstrap
Usage
Use the bootstrap on your application entry point.
import { bootstrap } from '@motech-development/bootstrap';
const api = NestFactory.create(RestApiModule);
const service = NestFactory.createMicroservice(MicroserviceModule);
const port = 8080; // Optional. Defaults to 3000. Can also be set using the PORT environment variable.
bootstrap(
{
api, // Optional
service, // Optional
},
port,
);