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

feat(certs): ENV variables updated and set CA Root for HTTPS server

This commit is contained in:
Saad Jutt
2022-06-21 03:17:14 +05:00
parent 87dbab98f6
commit 2119e9de9a
12 changed files with 81 additions and 43 deletions

View File

@@ -1,6 +1,8 @@
import path from 'path'
import fs from 'fs'
import {
SASSessionController,
JSSessionController,
getSASSessionController,
getJSSessionController,
processProgram
@@ -76,10 +78,19 @@ export class ExecutionController {
session: sessionByFileUpload,
runTime
}: ExecuteProgramParams): Promise<ExecuteReturnRaw | ExecuteReturnJson> {
const sessionController =
runTime === RunTimeType.SAS
? getSASSessionController()
: getJSSessionController()
let sessionController: SASSessionController | JSSessionController
switch (runTime) {
case RunTimeType.SAS:
sessionController = getSASSessionController()
break
case RunTimeType.JS:
sessionController = getJSSessionController()
break
default:
throw new Error('No Runtime is configured1')
}
const session =
sessionByFileUpload ?? (await sessionController.getSession())