https://github.com/sasjs/minimal-seed-app
Vanilla JavaScript seed app for SASjs
https://github.com/sasjs/minimal-seed-app
sas sasjs sasjs-app sasjs-seed-app viya
Last synced: about 2 months ago
JSON representation
Vanilla JavaScript seed app for SASjs
- Host: GitHub
- URL: https://github.com/sasjs/minimal-seed-app
- Owner: sasjs
- Created: 2020-07-09T05:41:45.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-11-25T11:30:15.000Z (4 months ago)
- Last Synced: 2025-11-28T17:25:10.127Z (4 months ago)
- Topics: sas, sasjs, sasjs-app, sasjs-seed-app, viya
- Language: JavaScript
- Homepage:
- Size: 14.3 MB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Vanilla JavaScript Seed App for SASjs
[](#contributors-)
This is the minimal seed app for [SASjs](https://github.com/sasjs/adapter).
## Quick Start on Viya
Just run the following in SAS Studio:
```sas
filename sasjsmsa url
"https://github.com/sasjs/minimal-seed-app/releases/latest/download/viya.sas";
%inc sasjsmsa;
```
This will deploy the streaming version of the app (compiled using `sasjs cb`)
## SAS9 Setup
Also works on Viya (but for that it is better to use the SASjs CLI).
To deploy the backend services, execute the following:
```sas
/* define the app location, eg in metadata or Viya folders service */
%let apploc=/Public/app/minimal-seed-app;
/* include macros directly, else download & compile manually */
filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;
/* create the two services */
filename ft15f001 temp;
parmcards4;
proc sql;
create table areas as select distinct area from sashelp.springs;
%webout(OPEN)
%webout(OBJ,areas)
%webout(CLOSE)
;;;;
%mp_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)
;;;;
%mp_createwebservice(path=&apploc/services/common, name=getdata)
```
Next, open the `src/index.html` file and update the `appLoc` in the `initSasJs()` function to the same folder location used above. Deploy to the SAS Web Server is recommended using the deploy NPM script provided in the `package.json` file.
It deploys the app to a specified server via SSH using the rsync command. Note - this is not available by default on Windows. A guide for installing it is available [here](https://sasjs.io/windows/#rsync).
To be able to run the deploy script, two environment variables need to be set:
`SSH_ACCOUNT` - your SSH account, this is of the form username@domain.com
`DEPLOY_PATH` - the path on the server where the app will be deployed to, typically `/var/www/html/`.
You can run the script like so:
```bash
SSH_ACCOUNT=me@my-sas-server.com
DEPLOY_PATH=/var/www/html/$(whoami)/minimal
npm run deploy
```
You are done!
## Local Development
You can put the frontend [directly on the SAS Web Server](https://sasjs.io/frontend/deployment/), else you can also use node to spin up a local web server with CORS disabled. To install, submit `npm install http-server -g`. To execute, navigate to the location where the app is to be loaded and submit: `npx http-server --cors`
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Allan Bowe
💻 ⚠️ 👀 📹 📖

Yury Shkoda
💻 ⚠️ 📆 📹 📖

Krishna Acondy
💻 ⚠️ 👀 🚇 📦 🚧 🖋

Muhammad Saad
💻 ⚠️ 👀 🧑🏫 📖

Sabir Hassan
💻 ⚠️ 👀 🤔

Mihajlo Medjedovic
💻 ⚠️ 👀 🚇

Vladislav Parhomchik
⚠️ 👀
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!