mirror of
https://github.com/sasjs/server.git
synced 2025-12-11 03:34:35 +00:00
chore: code fixes
This commit is contained in:
@@ -19,7 +19,7 @@ DB_CONNECT=mongodb+srv://<DB_USERNAME>:<DB_PASSWORD>@<CLUSTER>/<DB_NAME>?retryWr
|
||||
|
||||
RUN_TIMES=[sas|js|sas,js|js,sas] default considered as sas,js
|
||||
SAS_PATH=/opt/sas/sas9/SASHome/SASFoundation/9.4/sas
|
||||
NODE_PATH=/Users/username/.nvm/versions/node/v16.14.0/bin/node
|
||||
NODE_PATH=~/.nvm/versions/node/v16.14.0/bin/node
|
||||
|
||||
SASJS_ROOT=./sasjs_root
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
RunTimeType
|
||||
} from '../utils'
|
||||
|
||||
interface ExecuteSASCodePayload {
|
||||
interface ExecuteCodePayload {
|
||||
/**
|
||||
* Code of program
|
||||
* @example "* Code HERE;"
|
||||
@@ -32,17 +32,17 @@ export class CodeController {
|
||||
* @summary Run SAS Code and returns log
|
||||
*/
|
||||
@Post('/execute')
|
||||
public async executeSASCode(
|
||||
public async executeCode(
|
||||
@Request() request: express.Request,
|
||||
@Body() body: ExecuteSASCodePayload
|
||||
@Body() body: ExecuteCodePayload
|
||||
): Promise<ExecuteReturnJsonResponse> {
|
||||
return executeSASCode(request, body)
|
||||
return executeCode(request, body)
|
||||
}
|
||||
}
|
||||
|
||||
const executeSASCode = async (
|
||||
const executeCode = async (
|
||||
req: express.Request,
|
||||
{ code, runTime }: ExecuteSASCodePayload
|
||||
{ code, runTime }: ExecuteCodePayload
|
||||
) => {
|
||||
const { user } = req
|
||||
const userAutoExec =
|
||||
|
||||
@@ -11,7 +11,7 @@ runRouter.post('/execute', async (req, res) => {
|
||||
if (error) return res.status(400).send(error.details[0].message)
|
||||
|
||||
try {
|
||||
const response = await controller.executeSASCode(req, body)
|
||||
const response = await controller.executeCode(req, body)
|
||||
|
||||
if (response instanceof Buffer) {
|
||||
res.writeHead(200, (req as any).sasHeaders)
|
||||
|
||||
Reference in New Issue
Block a user