# Boilerplate for Express EB applications

This boilerplate defines the basic structure of Express applications that will
live on Elastic Beanstalk. It includes support for Sentry.

## Installing

- Install Node.js 14.15.5 or a later LTS version. It's recommended to use [nvm](https://github.com/creationix/nvm).
- Install [yarn](https://yarnpkg.com/lang/en/)
- Clone this folder
- Rename the `promo-theorchard-com` subfolder to your application's name
- Replace all occurrences of `promo-theorchard-com` with your application's name
- Run `yarn` to install the dependencies

## Running

- `yarn start`: Start the app with [nodemon](https://github.com/remy/nodemon)
- `yarn lint`: Run the linter with [standard](https://standardjs.com/)
- `yarn test`: Run the tests with [jest](https://facebook.github.io/jest/)

## Updating

- `yarn add <package_name>`: Add a dependency
- `yarn add -D <package_name>`: Add a development dependency
- You can update the `standard` block in `package.json` to configure the linter
- You can update the `jest` block in `package.json` to configure the test runner

## Notes

- [winston](https://github.com/winstonjs/winston) is used for logging
- If you want to run a local promo player app with a local frontend-audio-player app:
	- In `views/promo-player.pug` replace `src=playerAssetsUrl + '/audio-player.bundle.js'` with `src='http://localhost:8080/frontend-audio-player/audio-player.bundle.js'`
	- In `config.js` set `bffPromoPlayerUrl` to `'https://qa-bff-promo-player.theorchard.io'`
