Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
fix: pem file only in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Oct 14, 2022
1 parent 8dc48fd commit 0978e23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import * as fs from 'fs';
async function bootstrap() {
// DigitalOcean Apps has cert as environment variable but Mongo needs a file path
// Write Mongo cert file to disk
fs.writeFileSync('cert.pem', process.env.CA_CERT!);
if (process.env.CA_CERT) {
fs.writeFileSync('cert.pem', process.env.CA_CERT!);
}

const app = await NestFactory.create(AppModule);

Expand Down

0 comments on commit 0978e23

Please sign in to comment.