1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-04 21:30:05 +00:00

fix: refactored + removed unused package

This commit is contained in:
Saad Jutt
2022-02-15 04:04:38 +05:00
parent de47d78a00
commit d7e1aca7e3
6 changed files with 109 additions and 8570 deletions

View File

@@ -1,8 +1,7 @@
import path from 'path'
import { createServer } from 'https'
import { readFile } from '@sasjs/utils'
import appPromise from './app'
import { getCertificates } from './utils'
appPromise.then(async (app) => {
const protocol = process.env.PROTOCOL ?? 'http'
@@ -25,16 +24,3 @@ appPromise.then(async (app) => {
})
}
})
const getCertificates = async () => {
const privkey = process.env.PRIVATE_KEY ?? 'privkey.pem'
const fullchain = process.env.FULL_CHAIN ?? 'fullchain.pem'
const keyPath = path.join(process.cwd(), privkey)
const certPath = path.join(process.cwd(), fullchain)
const key = await readFile(keyPath)
const cert = await readFile(certPath)
return { key, cert }
}