0.0.6 • Published 5 years ago

spandx-deployment-service v0.0.6

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

spandx deployment service

REST API for deploying SPAs to the SPANDX platform.

Setup

npm install
npm start

Configuration

Configuration can be provided by CLI flags, environment variables, or a configuration file. Arguments are processed in that order, so CLI flags take precedence over environment variables, which take precedence over the configuration file.

OptionDescriptionCLIEnvconfig.jsonDefault
config fileWhere to find the config file.--config-fileSPANDX_CONFIG_FILEN/Astuff
upload dirDirectory to upload SPA archives.--upload-dirSPANDX_UPLOAD_DIR"upload-dir"/tmp/spandx_uploads
webrootDirectory to extract/deploy SPAs.--webrootSPANDX_WEBROOT"webroot"/var/www
metadata-dirDirectory to save SPA metadata.--metadata-dirSPANDX_METADATA_DIR"metadata-dir"The webroot value.
hostHostname to run on.--hostSPANDX_HOST"host"localhost
portPort to run on.--portSPANDX_PORT"port"8008

Note about the filepath configurations, config file, upload dir, and webroot: they must be absolute paths when defined in an environment variable or config file. When defined in CLI options like, they can be written relative to CWD. Example: --config-file=./config.json

SPA metadata

SPA metadata is saved into a directory defined by metadata-dir. Each deployed SPA gets a hidden directory inside metadata-dir which houses several files that contain the metadata.

For example, a SPA deployed under the path /my-app at version v1.0.0 would result in a

SPA metadata includes:

  • name
  • path
  • ref

Test with web UI

When you run the deployment service, it will print something like:

Listening on http://localhost:8008

Open that URL in a browser and you'll see a form for uploading apps.

Test with cURL

NAME="My Awesome Application"
SPA_PATH="/my-app"
REF="v1.0.0"
curl -v -F upload=@test.zip -F name="$NAME" -F path="$SPA_PATH" -F ref="$REF" localhost:8008/deploy

Change localhost:8008 to the host and port the service is running on. Change APP_NAME to your preferred app name, and test.zip to the archive you want to upload.

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago