Skip to content

sasjs/react-seed-app

Repository files navigation

Overview

All Contributors

This React seed app provides a wrapper for @sasjs/adapter, a lightning fast adapter for talking to SAS - on Viya, EBI, or SASjs Server.

Frontend Web

If you are running on SAS 9 you need to set serverType to SAS9 in sasContext.tsx.

  1. clone the repo and change into the directory
  2. run npm install
  3. run npm run build to create a production build in the build folder. This can be deployed to the SAS web server here.

If you are running locally you will also need to whitelist localhost on the server, or enable CORS in your browser as described here

Backend Services

The best way to deploy SAS services is using the SASjs CLI. Simply install, update the defaultTarget attribute in the sasjsconfig.json file, and run the following commands:

sasjs auth 
sasjs cbd

This will first authenticate to your target (follow the prompts) and after that you can just run sasjs cbd to rebuild and deploy your services. If you set streamweb:true in the sasjsconfig.json it will also deploy your frontend as a streaming app (no need for a web server).

If you are just looking to build quickly and don't have time to install NPM then you can also create the web services on ANY version of SAS by running the code below.

%let appLoc=/Public/app/react-seed-app; /* SAS Folders App Location */
filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;
filename ft15f001 temp;
parmcards4;
    proc sql;
    create table areas as select distinct area from sashelp.springs;
    %webout(OPEN)
    %webout(OBJ,areas)
    %webout(CLOSE)
;;;;
%mx_createwebservice(path=&appLoc/services/common, name=appinit)
parmcards4;
    %webout(FETCH)
    proc sql;
    create table springs as select * from sashelp.springs
      where area in (select area from areas);
    %webout(OPEN)
    %webout(OBJ,springs)
    %webout(CLOSE)
;;;;
%mx_createwebservice(path=&appLoc/services/common, name=getdata)

Supported Versions of SAS

This app will work on all versions of SAS Viya, in SAS 9 EBI from 9.3 and above, and on regular Foundation SAS (or WPS) installs using SASjs Server.

It will not work on SAS University edition.

Code Style

This project uses Prettier to format code. Please install the 'Prettier - Code formatter' extension for VS Code.

Files you are editing will automatically be formatted on save.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Allan Bowe

πŸ’» ⚠️ πŸ‘€ πŸ“Ή πŸ“–

Yury Shkoda

πŸ’» ⚠️ πŸ“† πŸ“Ή πŸ“–

Krishna Acondy

πŸ’» ⚠️ πŸ‘€ πŸš‡ πŸ“¦ 🚧 πŸ–‹

Muhammad Saad

πŸ’» ⚠️ πŸ‘€ πŸ§‘β€πŸ« πŸ“–

Sabir Hassan

πŸ’» ⚠️ πŸ‘€ πŸ€”

Mihajlo Medjedovic

πŸ’» ⚠️ πŸ‘€ πŸš‡

Vladislav Parhomchik

⚠️ πŸ‘€

This project follows the all-contributors specification. Contributions of any kind welcome!