How to use the @nestjs/core.NestFactory function in @nestjs/core

To help you get started, we’ve selected a few @nestjs/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github notadd / notadd / apps / noxus / cms / lib / main.js View on Github external
async function bootstrap() {
    const app = await core_1.NestFactory.create(cms_module_1.CmsModule, { bodyParser: false });
    app.connectMicroservice({
        transport: transport_enum_1.Transport.GRPC,
        options: {
            url: `${options.host}:3001`,
            package: 'noxus',
            protoPath: `${__dirname}/main.proto`
        }
    });
    await app.startAllMicroservicesAsync();
    // await app.listen(options.graphqlPort);
    await app.listen(9001);
}
exports.bootstrap = bootstrap;
github vellengs / nestx-server / dist / main.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
        const app = yield core_1.NestFactory.create(server_module_1.ApplicationModule);
        app.use(rateLimit({
            windowMs: 15 * 60 * 1000,
            max: 100
        }));
        app.setGlobalPrefix('api');
        swagger_1.setupSwagger(app);
        app.enableCors();
        app.use(helmet());
        app.useGlobalPipes(new common_1.ValidationPipe());
        app.use(compression());
        yield app.listen(5600);
    });
}
github vellengs / nestx / packages / server / dist / main.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
        const app = yield core_1.NestFactory.create(app_module_1.AppModule);
        app.use(cookieParser());
        app.setGlobalPrefix('api');
        swagger_1.setupSwagger(app);
        app.enableCors();
        app.use(helmet());
        app.useGlobalPipes(new common_1.ValidationPipe({
            transform: true,
            whitelist: true,
            forbidNonWhitelisted: true,
        }));
        app.use(compression());
        yield app.listen(5600);
    });
}
github mpcast / mpcast-server / packages / core / dist / bootstrap.js View on Github external
async function bootstrap(userConfig) {
    const config = await preBootstrapConfig(userConfig);
    config_1.Logger.info(`Bootstrapping Podcast Server...`);
    const appModule = await Promise.resolve().then(() => __importStar(require('./app.module')));
    let app;
    app = await core_1.NestFactory.create(appModule.AppModule, {
        cors: config.cors,
        logger: new config_1.Logger(),
    });
    app.use(helmet_1.default());
    app.use(bodyParser.json({ limit: '1mb' }));
    app.useGlobalFilters(new error_filter_1.HttpExceptionFilter());
    app.useGlobalPipes(new validation_pipe_1.ValidationPipe());
    app.useGlobalInterceptors(new transform_interceptor_1.TransformInterceptor(new core_1.Reflector()), new error_interceptor_1.ErrorInterceptor(new core_1.Reflector()), new logging_interceptor_1.LoggingInterceptor());
    await app.listen(config.port, config.hostname);
    logWelcomeMessage(config);
    return app;
}
exports.bootstrap = bootstrap;
github nestjs / nest / benchmarks / nest-fastify.js View on Github external
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const core_1 = require('@nestjs/core');
const fastify_platform_1 = require('@nestjs/platform-fastify');
const app_module_1 = require('./nest/app.module');
core_1.NestFactory.create(
  app_module_1.AppModule,
  new fastify_platform_1.FastifyAdapter(),
  {
    logger: false,
    bodyParser: false,
  },
).then(app => app.listen(3000));
//# sourceMappingURL=main.js.map