Creates bundles of JavaScript and CSS from Origami components.
- NodeJS 10 or higher
- python3 and pip (python package manager)
- Docker
- localstack (
pip install localstack
orpip3 install localstack
)
Before we can run the application, we'll need to install dependencies:
We install the dependencies inside a Docker container that mimics AWS Lambda's environment because we have dependencies that are environment specific (meaning they only work on the environment they are installed on. I.E. Installing on OS X and running on Linux will not work).
On OS X run:
npm run install-mac
On linux run:
npm run install
Run the application in development mode with:
This will start localstack in a Docker container.
On OS X run:
npm run start-localstack-mac
On linux run:
npm run start-localstack
To deploy the project into localstack: Don't worry about the output saying, the below, that is expected.
Serverless Error ---------------------------------------
Not Found On OS X run:
npm run deploy-local-mac
On linux run:
npm run deploy-local
Take note of the endpoints that serverless printed to the console, they will be wait we use to interact with the application. They look something like this:
Service Information service: obs stage: local region: us-east-1 stack: obs-local resources: 18 api keys: None endpoints: GET - http://localhost:4567/restapis/s7mywpb4zh/local/_user_request_/v3/bundles/js GET - http://localhost:4567/restapis/s7mywpb4zh/local/_user_request_/v3/update-origami-component-list
Import fixture data into the application:
npm run bootstrap
Now you can access the app over HTTP on the endpoints listed by Serverless.
To run the tests locally:
HOST=http://localhost:4567/restapis/s7mywpb4zh/local/_user_request_ npm run test
The Financial Times has published this software under the MIT license.