Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const address = `http://${host}:${port}`;
const application = yield core_1.notaddFactory.start(modules_1.ApplicationModule, {
bodyParser: true,
cors: true,
logger: services_1.LogService,
});
application.use(express.static(process.cwd() + "/public/"));
application.useGlobalPipes(new common_1.ValidationPipe());
if (swaggerConfiguration.enable) {
const options = new swagger_1.DocumentBuilder()
.setTitle("Notadd")
.setDescription("API document for Notadd.")
.setVersion("2.0")
.addBearerAuth()
.build();
const document = swagger_1.SwaggerModule.createDocument(application, options);
swagger_1.SwaggerModule.setup(`/${swaggerConfiguration.endpoint}`, application, document);
}
const callback = () => {
if (graphqlConfiguration.ide.enable) {
this.logger.log(`Graphql IDE Server on: ${address}/graphiql`);
}
if (swaggerConfiguration.enable) {
this.logger.log(`Swagger Server on: ${address}/${swaggerConfiguration.endpoint}`);
}
this.logger.log(`Server on: ${address}`);
};
index = process.argv.indexOf("--host");
if (index > -1) {
yield application.listen(port, process.argv[index + 1], callback);
}
else if (serverConfiguration.http.host && serverConfiguration.http.host !== "*") {
bodyParser: true,
cors: true,
logger: services_1.LogService,
});
application.use(express.static(process.cwd() + "/public/"));
}
application.useGlobalPipes(new common_1.ValidationPipe());
const swaggerConfiguration = loaders_1.Configuration.loadSwaggerConfiguration();
if (serverConfiguration.adapter !== "fastify" && swaggerConfiguration.enable) {
const options = new swagger_1.DocumentBuilder()
.setTitle("Notadd")
.setDescription("API document for Notadd.")
.setVersion("2.0")
.addBearerAuth()
.build();
const document = swagger_1.SwaggerModule.createDocument(application, options);
swagger_1.SwaggerModule.setup(`/${swaggerConfiguration.endpoint}`, application, document);
}
const callback = () => {
if (graphqlConfiguration.ide.enable) {
this.logger.log(`Graphql IDE Server on: ${address}/graphiql`);
}
if (serverConfiguration.adapter !== "fastify" && swaggerConfiguration.enable) {
this.logger.log(`Swagger Server on: ${address}/${swaggerConfiguration.endpoint}`);
}
this.logger.log(`Server on: ${address}`);
};
index = process.argv.indexOf("--host");
if (index > -1) {
await application.listen(port, process.argv[index + 1], callback);
}
else if (serverConfiguration.http.host && serverConfiguration.http.host !== "*") {
cors: true,
logger: services_1.LogService,
});
application.use(express.static(process.cwd() + "/public/"));
}
application.useGlobalPipes(new common_1.ValidationPipe());
const swaggerConfiguration = loaders_1.Configuration.loadSwaggerConfiguration();
if (serverConfiguration.adapter !== "fastify" && swaggerConfiguration.enable) {
const options = new swagger_1.DocumentBuilder()
.setTitle("Notadd")
.setDescription("API document for Notadd.")
.setVersion("2.0")
.addBearerAuth()
.build();
const document = swagger_1.SwaggerModule.createDocument(application, options);
swagger_1.SwaggerModule.setup(`/${swaggerConfiguration.endpoint}`, application, document);
}
const callback = () => {
if (graphqlConfiguration.ide.enable) {
this.logger.log(`Graphql IDE Server on: ${address}/graphiql`);
}
if (serverConfiguration.adapter !== "fastify" && swaggerConfiguration.enable) {
this.logger.log(`Swagger Server on: ${address}/${swaggerConfiguration.endpoint}`);
}
this.logger.log(`Server on: ${address}`);
};
index = process.argv.indexOf("--host");
if (index > -1) {
await application.listen(port, process.argv[index + 1], callback);
}
else if (serverConfiguration.http.host && serverConfiguration.http.host !== "*") {
await application.listen(port, serverConfiguration.http.host, callback);
const application = yield core_1.notaddFactory.start(modules_1.ApplicationModule, {
bodyParser: true,
cors: true,
logger: services_1.LogService,
});
application.use(express.static(process.cwd() + "/public/"));
application.useGlobalPipes(new common_1.ValidationPipe());
if (swaggerConfiguration.enable) {
const options = new swagger_1.DocumentBuilder()
.setTitle("Notadd")
.setDescription("API document for Notadd.")
.setVersion("2.0")
.addBearerAuth()
.build();
const document = swagger_1.SwaggerModule.createDocument(application, options);
swagger_1.SwaggerModule.setup(`/${swaggerConfiguration.endpoint}`, application, document);
}
const callback = () => {
if (graphqlConfiguration.ide.enable) {
this.logger.log(`Graphql IDE Server on: ${address}/graphiql`);
}
if (swaggerConfiguration.enable) {
this.logger.log(`Swagger Server on: ${address}/${swaggerConfiguration.endpoint}`);
}
this.logger.log(`Server on: ${address}`);
};
index = process.argv.indexOf("--host");
if (index > -1) {
yield application.listen(port, process.argv[index + 1], callback);
}
else if (serverConfiguration.http.host && serverConfiguration.http.host !== "*") {
yield application.listen(port, serverConfiguration.http.host, callback);