From adccca6c7fc06b5eea2a57ac47e0d9080afafbc0 Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Tue, 15 Feb 2022 21:53:54 +0500 Subject: [PATCH] chore: updated README.md --- README.md | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 25c8e6c..c6ea2f8 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,19 @@ SASjs Server provides a NodeJS wrapper for calling the SAS binary executable. It One major benefit of using SASjs Server (alongside other components of the SASjs framework such as the [CLI](https://cli.sasjs.io), [Adapter](https://adapter.sasjs.io) and [Core](https://core.sasjs.io) library) is that the projects you create can be very easily ported to SAS 9 (Stored Process server) or Viya (Job Execution server). SASjs Server is available in two modes - Desktop (without authentication) and Server (with authentiation, and a database) + ## Desktop Version ### Manual Installation + Download the relevant package from the [releases](https://github.com/sasjs/server/releases) page Next, trigger by double clicking (windows) or executing from commandline. You are presented with two prompts: -* Location of your `sas.exe` / `sas.sh` executable -* Path to a filesystem location for Stored Programs and temporary files - +- Location of your `sas.exe` / `sas.sh` executable +- Path to a filesystem location for Stored Programs and temporary files ## Programmatic Installation @@ -33,7 +34,7 @@ unzip linux.zip The app can then be launched with `./api-linux` and prompts followed. -When launching the app, it will make use of specific environment variables. These can be set in the following places: +When launching the app, it will make use of specific environment variables. These can be set in the following places: - Configured globally in /etc/environment file - Export in terminal or shell script (`export VAR=VALUE`) @@ -50,26 +51,34 @@ DRIVE_PATH=./tmp Setting these prompts variables will avoid the need for prompts. -Normally the server process will stop when your terminal dies. To keep it going you can use the npm package [forever](https://www.npmjs.com/package/forever) (`npm i -g forever`) as follows: +Normally the server process will stop when your terminal dies. To keep it going you can use the npm package [pm2](https://www.npmjs.com/package/pm2) (`npm install pm2@latest -g`) as follows: ```bash export SAS_PATH=/opt/sas9/SASHome/SASFoundation/9.4/sasexe/sas export PORT=5001 export DRIVE_PATH=./tmp -forever start -c "./api-linux" ./ +pm2 start api-linux ``` -To get the log files: +To get the logs (and some usefull commands): + ```bash -forever list -# grap log file link -tail -f LOGFILE +pm2 [list|ls|status] +pm2 logs +pm2 logs --lines 200 ``` -To stop: +Managing processes: ``` -forever stop +pm2 restart app_name +pm2 reload app_name +pm2 stop app_name +pm2 delete app_name ``` +Instead of `app_name` you can pass: + +- `all` to act on all processes +- `id` to act on a specific process id