diff --git a/README.md b/README.md index d2dec6a..365b4c2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # SASjs Server + + [![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-) + 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 -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! \ No newline at end of file +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! diff --git a/api/.env.example b/api/.env.example index c79af41..cdb2431 100644 --- a/api/.env.example +++ b/api/.env.example @@ -19,7 +19,7 @@ DB_CONNECT=mongodb+srv://:@/?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 diff --git a/api/src/controllers/code.ts b/api/src/controllers/code.ts index 7ae5c18..1e09c4d 100644 --- a/api/src/controllers/code.ts +++ b/api/src/controllers/code.ts @@ -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 { - 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 = diff --git a/api/src/routes/api/code.ts b/api/src/routes/api/code.ts index 8e866c5..09171c0 100644 --- a/api/src/routes/api/code.ts +++ b/api/src/routes/api/code.ts @@ -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)