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

chore: restructure repo into sub folders

This commit is contained in:
2021-10-20 11:43:10 +00:00
parent 99d55775aa
commit d530e0801e
28 changed files with 18 additions and 2 deletions

19
api/src/prod-server.ts Normal file
View File

@@ -0,0 +1,19 @@
import path from 'path'
import { readFileSync } from 'fs'
import * as https from 'https'
import { configuration } from '../package.json'
import app from './app'
const keyPath = path.join('certificates', 'privkey.pem')
const certPath = path.join('certificates', 'fullchain.pem')
const key = readFileSync(keyPath)
const cert = readFileSync(certPath)
const httpsServer = https.createServer({ key, cert }, app)
httpsServer.listen(configuration.sasJsPort, () => {
console.log(
`⚡️[server]: Server is running at https://localhost:${configuration.sasJsPort}`
)
})