1.3.0-beta.5 • Published 28 days ago

@boomerang-io/webapp-spa-server v1.3.0-beta.5

Weekly downloads
27
License
Apache-2.0
Repository
github
Last release
28 days ago

Webapp SPA Server

Provide a consistent way to deploy Boomerang React SPAs with client-side routing into an IBM Cloud Private environment.

Features

Design

The server can be invoked via a command line or imported as a configurable function to be executed.

  • CLI - for easy stand alone use that can be invoked via a script e.g. in npm scripts
  • Function - create server and run it within a node.js file

CLI

The server can be run via the CLI interface with configuration pass as options.

Enter the following to see the manual

boomerang-webapp-server --help

Command

boomerang-webapp-server serve

Options

OptionAliasDescription
--cors-cCORS configuration using cors package. Accepts JSON string
--disableInjectHTMLHeadData-dToggle whether the app needs to inject data into the header. Defaults to false
--dotenvFilePath-pPath to local .env file to read in. Useful for local testing

Use as a function

const server = require("@boomerang-io/webapp-spa-server");
server({
  cors: {},
  disableInjectHTMLHeadData: true,
});

Environment Variables

The following env variables are assumed to exist either from a local .env file or passed in to the container at runtime. If nothing is passed it, it will default to the following:

VariablePurposeType
APP_ROOTRoot context of the applicationstring
BUILD_DIRdirectory relative to the exeuction where app files are locatedstring
HTML_HEAD_INJECTED_DATA_KEYSEnvironment variables to inject into the HTML documentcomma delimited list
HTML_HEAD_INJECTED_SCRIPTSScripts to inject into HTML document. Files need to be in the BUILD_DIRcomma delimited list
NEW_RELIC_APP_NAMEApp name for monitoringstring
NEW_RELIC_LICENSE_KEYLicense key for monitoringstring
PORTPort for server to run onnumber

Defaults

Some of the values, both config and environment variables have defaults in the server that make deploying to the IBM Cloud Private work out-of-the-box.

APP_ROOT

  • "/"

BUILD_DIR

  • "build"

CORS

{
  "origin": "*",
  "allowedHeaders": "Content-Type, Authorization, Content-Length, X-Requested-With",
  "methods": "DELETE,GET,OPTIONS,PATCH,POST,PUT"
}

HTML_HEAD_INJECTED_DATA_KEYS

  • APP_ROOT
  • BASE_APPS_ENV_URL
  • BASE_LAUNCH_ENV_URL
  • BASE_SERVICE_ENV_URL
  • BASE_WWW_ENV_URL
  • CORE_APPS_ENV_URL
  • CORE_ENV_URL
  • CORE_SERVICE_ENV_URL
  • PRODUCT_APPS_ENV_URL
  • PRODUCT_ENV_URL
  • PRODUCT_SERVICE_ENV_URL

PORT

  • 3000
1.3.0-beta.11

28 days ago

1.3.0-beta.10

29 days ago

1.3.0-beta.6

1 month ago

1.3.0-beta.7

1 month ago

1.3.0-beta.8

1 month ago

1.3.0-beta.9

1 month ago

1.3.0-beta.5

1 month ago

1.2.5

1 month ago

1.2.4

1 month ago

1.3.0-beta.3

2 months ago

1.3.0-beta.4

2 months ago

1.3.0-beta.1

2 months ago

1.3.0-beta.2

2 months ago

1.3.0-beta.0

2 months ago

1.2.3

3 months ago

1.2.3-beta.1

4 months ago

1.2.3-beta.2

4 months ago

1.2.2-beta.0

4 months ago

1.2.3-beta.0

4 months ago

1.2.2

9 months ago

1.2.1

2 years ago

1.2.0

2 years ago

1.2.1-beta.0

2 years ago

1.2.0-beta.0

2 years ago

1.1.1-beta.1

2 years ago

0.0.12-beta.0

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

0.0.12-beta.1

2 years ago

1.0.0

2 years ago

1.0.2-beta.2

2 years ago

1.0.2-beta.3

2 years ago

1.0.2-beta.0

2 years ago

1.0.1-beta.0

2 years ago

1.0.2-beta.1

2 years ago

1.0.0-beta.0

2 years ago

1.1.0-beta.1

2 years ago

1.1.0-beta.0

2 years ago

0.0.11-beta.19

3 years ago

0.0.11-beta.18

3 years ago

0.0.11-beta.17

3 years ago

0.0.11-beta.16

3 years ago

0.0.11-beta.15

3 years ago

0.0.11-beta.14

3 years ago

0.0.11-beta.13

3 years ago

0.0.11-beta.12

3 years ago

0.0.11-beta.11

3 years ago

0.0.11-beta.10

3 years ago

0.0.11-beta.8

3 years ago

0.0.11-beta.7

3 years ago

0.0.11-beta.9

3 years ago

0.0.11-beta.4

3 years ago

0.0.11-beta.3

3 years ago

0.0.11-beta.2

3 years ago

0.0.11-beta.6

3 years ago

0.0.11-beta.5

3 years ago

0.0.11-beta.0

3 years ago

0.0.10

3 years ago

0.0.11-beta.1

3 years ago

0.0.9-beta.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago