Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
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);
});
}
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);
});
}
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;
'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