1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 19:34:34 +00:00

chore: code fixes

This commit is contained in:
Saad Jutt
2022-06-19 18:35:10 +05:00
parent dde293c852
commit b1a0fe7060
4 changed files with 13 additions and 10 deletions

View File

@@ -1,6 +1,9 @@
# SASjs Server
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
SASjs Server provides a NodeJS wrapper for calling the SAS binary executable. It can be installed on an actual SAS server, or locally on your desktop. It provides:
@@ -65,7 +68,7 @@ MODE=
SAS_PATH=/path/to/sas/executable.exe
# Path to Node.js executable
NODE_PATH=node
NODE_PATH=~/.nvm/versions/node/v16.14.0/bin/node
# Path to working directory
# This location is for SAS WORK, staged files, DRIVE, configuration etc
@@ -224,4 +227,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

View File

@@ -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

View File

@@ -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 =

View File

@@ -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)