I'm stuck in connecting my Nestjs server to the MongoDB database both are on the same app platform in the digital ocean. The main problem is in providing the ca.certificate.crt file to the Nestjs server. I'm using MongoDB with typeorm and nestjs.
const mongodb_config: ConnectionOptions = {
type: "mongodb",
url: `${getValue("MONGO_URL")}/${MONGODB_DATABASE}`,
name: DB_CONNECTION.MONGO_CONNECTION,
entities: [LivePriceEntity],
logging: ENVIRONMENT === ENVIRONMENTS.LOCAL,
useUnifiedTopology: true,
useNewUrlParser: true,
ssl: ENVIRONMENT === ENVIRONMENTS.LOCAL ? false : true,
sslValidate: ENVIRONMENT === ENVIRONMENTS.LOCAL ? false : true,
sslCert: ENVIRONMENT === ENVIRONMENTS.LOCAL ? "" : SSL_CA_CERT,
cli: {
entitiesDir: "src/app/**/entities/*.entity{.ts,.js}",
}
};
This is my typeorm connection config. Please help me out.