@ministryofjustice/fb-runner-node
Form Builder Runner (for Node)
Last updated 2 months ago by form-builder-developers .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ministryofjustice/fb-runner-node 
SYNC missed versions from official npm registry.

fb-runner-node

Form Builder Runner renders forms from configuration data to capture user submissions.

For more information, read the Runner’s documentation.

Pre-requisites

Node >= 12.4.0

Installation

git clone git@github.com:ministryofjustice/fb-runner-node.git
cd fb-runner-node
npm install

Usage

The SERVICE_PATH environment variable describes the location on your file system of the form for Runner to use.

To set the SERVICE_PATH environment variable, open a terminal and change into the root directory of Runner, then execute the command:

SERVICE_PATH=[path to form] npm start

(Where [path to form] is a path to the location on your file system of the form. An Example Service form can be cloned from https://github.com/ministryofjustice/fb-example-service.)

By default, Runner will start on localhost port 3000. To run on a different port, set the PORT environment variable:

PORT=4321 SERVICE_PATH=[path to form] npm start

Using Runner with Mock Services

Use fb-mock-services to mock services for Runner.

Clone the fb-mock-services repository and start the Mock Services app according to the instructions supplied there.

In Runner, create an .envmocks file at the root of the project:

export SERVICE_SLUG=slug
export SERVICE_SECRET=secret
export SERVICE_TOKEN=token
export USER_DATASTORE_URL=http://localhost:44444
export USER_FILESTORE_URL=http://localhost:44445
export SUBMITTER_URL=http://localhost:44446

Open a terminal and change into the root directory of Runner then execute the command:

source .envmocks && SERVICE_PATH=[path to form] npm start

(Where [path to form] is a path to the location on your file system of the form.)

Using Runner with Docker Services

Use fb-acceptance-tests to mock services for Runner.

Clone the fb-acceptance-tests repository and execute the make serve command according to the instructions supplied there.

In Runner, create an .envmocks file at the root of the project:

export SERVICE_SLUG=slug
export SERVICE_SECRET=secret
export SERVICE_TOKEN=token
export USER_DATASTORE_URL=http://localhost:10001
export USER_FILESTORE_URL=http://localhost:10002
export SUBMITTER_URL=http://localhost:10003
export ENCODED_PRIVATE_KEY=[encoded private key]
export ENCODED_PUBLIC_KEY=[encoded public key]

Where [encoded private key] and [encoded public key] are the same as the values supplied to the services in the docker-compose.yml file at the root of the fb-acceptance-test project. (Currently, they are also contained in .env.example file at the root of this project.)

Open a terminal and change into the root directory of Runner then execute the command:

source .envmocks && SERVICE_PATH=[path to form] npm start

(Where [path to form] is a path to the location on your file system of the form.)

Testing

npm test

Linting

npm run lint

Debugging

Node inspector can be enabled for debugging.

Open a terminal and change into the root directory of Runner then execute the command:

PORT=4321 SERVICE_PATH=[path to form] node inspect bin/start

(Where [path to form] is a path to the location on your file system of the form.)

Note that the start command is not npm start.

The breakpoint statement debugger can then be placed in file to trigger the inspector.

Deploying to Cloud Platforms

See deployment instructions.

Module Aliases

Some module paths are aliased.

At runtime they are resolved with @ministryofjustice/module-alias. (Its definitions can be found in the _moduleAliases {} field on package.json.)

During development aliases can be resolved in different ways according to needs of the developer's IDE. A solution we provide is via Webpack, which is supported automatically in WebStorm and related IDEs, or with some manual steps.

At start-up WebStorm will report in the Event Log that "Module resolution rules from webpack.config.js are now used for coding assistance" if the configuration is automatically identified -- if not, follow the manual steps:

  1. Right-click on the lib directory and select Mark Directory as > Resource root
  2. From the application menu select Preferences > Languages & Frameworks > JavaScript > Webpack then in the right-hand pane use the file browser to select webpack.config.js from the package root

You shouldn't need to restart but it won't hurt.

Current Tags

  • 0.3.1                                ...           latest (2 months ago)

193 Versions

  • 0.3.1                                ...           2 months ago
  • 0.3.0                                ...           2 months ago
  • 0.2.2                                ...           2 months ago
  • 0.2.1                                ...           2 months ago
  • 0.2.0                                ...           2 months ago
  • 0.1.47                                ...           3 months ago
  • 0.1.46                                ...           3 months ago
  • 0.1.45                                ...           3 months ago
  • 0.1.44                                ...           3 months ago
  • 0.1.43                                ...           3 months ago
  • 0.1.42                                ...           3 months ago
  • 0.1.41                                ...           3 months ago
  • 0.1.40                                ...           3 months ago
  • 0.1.39                                ...           3 months ago
  • 0.1.38                                ...           3 months ago
  • 0.1.37                                ...           4 months ago
  • 0.1.36                                ...           4 months ago
  • 0.1.35                                ...           4 months ago
  • 0.1.34                                ...           4 months ago
  • 0.1.33                                ...           4 months ago
  • 0.1.32                                ...           4 months ago
  • 0.1.30                                ...           4 months ago
  • 0.1.28                                ...           5 months ago
  • 0.1.27                                ...           5 months ago
  • 0.1.26                                ...           5 months ago
  • 0.1.25                                ...           5 months ago
  • 0.1.24                                ...           5 months ago
  • 0.1.23                                ...           5 months ago
  • 0.1.21                                ...           5 months ago
  • 0.1.18                                ...           6 months ago
  • 0.1.19                                ...           6 months ago
  • 0.1.16                                ...           6 months ago
  • 0.1.15                                ...           6 months ago
  • 0.1.13                                ...           6 months ago
  • 0.1.12                                ...           6 months ago
  • 0.1.11                                ...           7 months ago
  • 0.1.9                                ...           7 months ago
  • 0.1.6                                ...           7 months ago
  • 0.1.5                                ...           7 months ago
  • 0.1.4                                ...           7 months ago
  • 0.1.3                                ...           7 months ago
  • 0.1.2                                ...           7 months ago
  • 0.1.1                                ...           7 months ago
  • 0.1.0                                ...           7 months ago
  • 0.0.160                                ...           9 months ago
  • 0.0.159                                ...           10 months ago
  • 0.0.158-2                                ...           10 months ago
  • 0.0.158-1                                ...           10 months ago
  • 0.0.158                                ...           10 months ago
  • 0.0.157                                ...           a year ago
  • 0.0.156                                ...           a year ago
  • 0.0.155                                ...           a year ago
  • 0.0.154                                ...           a year ago
  • 0.0.153                                ...           a year ago
  • 0.0.152                                ...           a year ago
  • 0.0.151                                ...           a year ago
  • 0.0.150                                ...           a year ago
  • 0.0.148                                ...           a year ago
  • 0.0.146-2                                ...           a year ago
  • 0.0.146-1                                ...           a year ago
  • 0.0.147                                ...           a year ago
  • 0.0.146                                ...           a year ago
  • 0.0.145-6                                ...           a year ago
  • 0.0.145                                ...           a year ago
  • 0.0.144                                ...           a year ago
  • 0.0.143                                ...           a year ago
  • 0.0.142-alpha                                ...           a year ago
  • 0.0.141-alpha                                ...           a year ago
  • 0.0.140-alpha                                ...           a year ago
  • 0.0.139-alpha                                ...           a year ago
  • 0.0.138-alpha                                ...           a year ago
  • 0.0.137-alpha                                ...           a year ago
  • 0.0.136-alpha                                ...           a year ago
  • 0.0.135-alpha                                ...           a year ago
  • 0.0.134-alpha                                ...           a year ago
  • 0.0.133-alpha                                ...           a year ago
  • 0.0.132-alpha                                ...           a year ago
  • 0.0.131-alpha                                ...           a year ago
  • 0.0.130-alpha                                ...           a year ago
  • 0.0.129-alpha                                ...           a year ago
  • 0.0.127-alpha                                ...           a year ago
  • 0.0.126-alpha                                ...           a year ago
  • 0.0.125-alpha                                ...           a year ago
  • 0.0.124-alpha                                ...           a year ago
  • 0.0.122-alpha                                ...           a year ago
  • 0.0.121-alpha                                ...           a year ago
  • 0.0.120-alpha                                ...           a year ago
  • 0.0.119-alpha                                ...           a year ago
  • 0.0.118-alpha                                ...           a year ago
  • 0.0.117-alpha                                ...           a year ago
  • 0.0.116-alpha                                ...           a year ago
  • 0.0.114-alpha                                ...           a year ago
  • 0.0.113-alpha                                ...           a year ago
  • 0.0.112-alpha                                ...           a year ago
  • 0.0.111-alpha                                ...           a year ago
  • 0.0.110-alpha                                ...           2 years ago
  • 0.0.108-alpha                                ...           2 years ago
  • 0.0.107-alpha                                ...           2 years ago
  • 0.0.106-alpha                                ...           2 years ago
  • 0.0.105-alpha                                ...           2 years ago
  • 0.0.104-alpha                                ...           2 years ago
  • 0.0.103-alpha                                ...           2 years ago
  • 0.0.102-alpha                                ...           2 years ago
  • 0.0.101-alpha                                ...           2 years ago
  • 0.0.100-alpha                                ...           2 years ago
  • 0.0.99-alpha                                ...           2 years ago
  • 0.0.98-alpha                                ...           2 years ago
  • 0.0.97-alpha                                ...           2 years ago
  • 0.0.96-alpha                                ...           2 years ago
  • 0.0.95-alpha                                ...           2 years ago
  • 0.0.94-alpha                                ...           2 years ago
  • 0.0.93-alpha                                ...           2 years ago
  • 0.0.92-alpha                                ...           2 years ago
  • 0.0.91-alpha                                ...           2 years ago
  • 0.0.90-alpha                                ...           2 years ago
  • 0.0.89-alpha                                ...           2 years ago
  • 0.0.88-alpha                                ...           2 years ago
  • 0.0.86-alpha                                ...           2 years ago
  • 0.0.85-alpha                                ...           2 years ago
  • 0.0.84-alpha                                ...           2 years ago
  • 0.0.83-alpha                                ...           2 years ago
  • 0.0.82-alpha                                ...           2 years ago
  • 0.0.81-alpha                                ...           2 years ago
  • 0.0.80-alpha                                ...           2 years ago
  • 0.0.78-alpha                                ...           2 years ago
  • 0.0.77-alpha                                ...           2 years ago
  • 0.0.76-alpha                                ...           2 years ago
  • 0.0.75-alpha                                ...           2 years ago
  • 0.0.74-alpha                                ...           2 years ago
  • 0.0.73-alpha                                ...           2 years ago
  • 0.0.72-alpha                                ...           2 years ago
  • 0.0.71-alpha                                ...           2 years ago
  • 0.0.70-alpha                                ...           2 years ago
  • 0.0.69-alpha                                ...           2 years ago
  • 0.0.68-alpha                                ...           2 years ago
  • 0.0.67-alpha                                ...           2 years ago
  • 0.0.66-alpha                                ...           2 years ago
  • 0.0.65-alpha                                ...           2 years ago
  • 0.0.64-alpha                                ...           2 years ago
  • 0.0.63-alpha                                ...           2 years ago
  • 0.0.62-alpha                                ...           2 years ago
  • 0.0.61-alpha                                ...           2 years ago
  • 0.0.60-alpha                                ...           2 years ago
  • 0.0.59-alpha                                ...           2 years ago
  • 0.0.58-alpha                                ...           2 years ago
  • 0.0.57-alpha                                ...           2 years ago
  • 0.0.56-alpha                                ...           2 years ago
  • 0.0.55-alpha                                ...           2 years ago
  • 0.0.54-alpha                                ...           2 years ago
  • 0.0.53-alpha                                ...           2 years ago
  • 0.0.52-alpha                                ...           2 years ago
  • 0.0.51-alpha                                ...           2 years ago
  • 0.0.50-alpha                                ...           2 years ago
  • 0.0.48-alpha                                ...           2 years ago
  • 0.0.47-alpha                                ...           2 years ago
  • 0.0.46-alpha                                ...           2 years ago
  • 0.0.45-alpha                                ...           2 years ago
  • 0.0.43-alpha                                ...           2 years ago
  • 0.0.42-alpha                                ...           2 years ago
  • 0.0.41-alpha                                ...           2 years ago
  • 0.0.40-alpha                                ...           2 years ago
  • 0.0.39-alpha                                ...           2 years ago
  • 0.0.38-alpha                                ...           2 years ago
  • 0.0.37-alpha                                ...           2 years ago
  • 0.0.36-alpha                                ...           2 years ago
  • 0.0.35-alpha                                ...           2 years ago
  • 0.0.34-alpha                                ...           2 years ago
  • 0.0.33-alpha                                ...           2 years ago
  • 0.0.32-alpha                                ...           2 years ago
  • 0.0.31-alpha                                ...           2 years ago
  • 0.0.30-alpha                                ...           2 years ago
  • 0.0.29-alpha                                ...           2 years ago
  • 0.0.28-alpha                                ...           2 years ago
  • 0.0.27-alpha                                ...           2 years ago
  • 0.0.26-alpha                                ...           2 years ago
  • 0.0.25-alpha                                ...           2 years ago
  • 0.0.24-alpha                                ...           2 years ago
  • 0.0.23-alpha                                ...           2 years ago
  • 0.0.22-alpha                                ...           2 years ago
  • 0.0.21-alpha                                ...           2 years ago
  • 0.0.20-alpha                                ...           2 years ago
  • 0.0.19-alpha                                ...           2 years ago
  • 0.0.16-alpha                                ...           2 years ago
  • 0.0.15-alpha                                ...           2 years ago
  • 0.0.14-alpha                                ...           2 years ago
  • 0.0.13-alpha                                ...           2 years ago
  • 0.0.12-alpha                                ...           2 years ago
  • 0.0.11-alpha                                ...           2 years ago
  • 0.0.4-alpha                                ...           2 years ago
  • 0.0.3-alpha                                ...           2 years ago
  • 0.0.2-alpha                                ...           2 years ago
  • 0.0.1-alpha                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (58)

Copyright 2014 - 2017 © taobao.org |