1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 11:24:35 +00:00
2022-02-28 22:12:39 +05:00
2022-02-11 12:05:05 +01:00
2021-11-14 00:55:30 +05:00
2022-02-28 22:12:39 +05:00
2022-02-20 05:03:48 +05:00
2022-02-16 21:41:25 +00:00
2022-02-16 21:43:01 +00:00
2022-02-16 21:43:01 +00:00
2022-02-16 21:43:01 +00:00
2022-02-08 21:45:56 +05:00

SASjs Server

SASjs Server provides a NodeJS wrapper for calling the SAS binary executable. It can be installed on an actual SAS server, or it could even run locally on your desktop. It provides the following functionality:

  • Virtual filesystem for storing SAS programs and other content
  • Ability to execute Stored Programs from a URL
  • Ability to create web apps using simple Desktop SAS

One major benefit of using SASjs Server (alongside other components of the SASjs framework such as the CLI, Adapter and Core 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)

Configuration

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)
  • Prepend in command
  • Enter in the .env file alongside the executable

Example variables:

MODE=[desktop|server] default considered as desktop
CORS=[disable|enable] default considered as disable
PROTOCOL=[http|https] default considered as http
PORT=[5000] default value is 5000
PORT_WEB=[port for sasjs web component(react)] default value is 3000
SAS_PATH=/path/to/sas/executable.exe
DRIVE_PATH=./tmp
PROTOCOL=[http|https] default considered as http. Use pems below if htttps.
PRIVATE_KEY=privkey.pem
FULL_CHAIN=fullchain.pem

Desktop Version

Manual Installation

Download the relevant package from the releases page

Next, trigger by double clicking (windows) or executing from commandline.

You are presented with two prompts (if not set as ENV vars):

  • Location of your sas.exe / sas.sh executable
  • Path to a filesystem location for Stored Programs and temporary files

Programmatic Installation

Fetch the relevant package from github using curl, eg as follows (for linux):

curl -L https://github.com/sasjs/server/releases/latest/download/linux.zip > linux.zip
unzip linux.zip

The app can then be launched with ./api-linux and prompts followed (if ENV vars not set).

Normally the server process will stop when your terminal dies. To keep it going you can use the npm package pm2 (npm install pm2@latest -g) as follows:

export SAS_PATH=/opt/sas9/SASHome/SASFoundation/9.4/sasexe/sas
export PORT=5001
export DRIVE_PATH=./tmp

pm2 start api-linux

To get the logs (and some usefull commands):

pm2 [list|ls|status]
pm2 logs
pm2 logs --lines 200

Managing processes:

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

Server Version

The following credentials can be used for the initial connection to SASjs/server. It is recommended to change these on first use.

  • CLIENTID: clientID1
  • USERNAME: secretuser
  • PASSWORD: secretpassword
Description
Build Apps on Base SAS
Readme MIT 16 MiB
Languages
TypeScript 74.6%
CSS 24.2%
JavaScript 0.6%
Shell 0.3%
HTML 0.2%