summaryrefslogtreecommitdiff
path: root/src/main.ts
diff options
context:
space:
mode:
authorJoseph Ditton <jditton.atomic@gmail.com>2021-11-03 19:25:40 -0600
committerJoseph Ditton <jditton.atomic@gmail.com>2021-11-03 19:25:40 -0600
commitceb7e5cf2c815f862b6b13a3c76d34a83655edef (patch)
treec1c913e32996935a67f9e8996aa5b569bdebba05 /src/main.ts
parent6dd39fcd58d7a5550a2f0cdac453f9964d0de6a4 (diff)
downloadlocchat-ceb7e5cf2c815f862b6b13a3c76d34a83655edef.tar.gz
locchat-ceb7e5cf2c815f862b6b13a3c76d34a83655edef.zip
update readme and adds ssl
Diffstat (limited to 'src/main.ts')
-rw-r--r--src/main.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.ts b/src/main.ts
index 90ecef4..4483c3b 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,11 +1,21 @@
import { config } from 'dotenv';
+import * as fs from 'fs';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
config();
async function bootstrap() {
- const app = await NestFactory.create(AppModule);
+ let httpsOptions;
+ if (process.env.NODE_ENV === 'development') {
+ httpsOptions = {
+ key: fs.readFileSync('./private-key.pem'),
+ cert: fs.readFileSync('./public-cert.pem'),
+ }
+ }
+ const app = await NestFactory.create(AppModule, {
+ httpsOptions
+ });
await app.listen(process.env.PORT);
}
bootstrap();