git clone https://github.com/mozilla/blurts-server.git
Copy the .env-dist file to .env:
cp .env-dist .env
Run the server:
Note: npm start uses onchange and nodemon to automatically detect file changes, re-compile static assets, and restart the express process. If you want more control, see the scripts section of package.json for more commands.
Breach alert emails are triggered via HIBP. For dev purposes, we can trigger them ourselves to send to a Mailinator email address.
To set up your environment for email testing with Mailinator:
In your .env file, confirm or add values for SMTP_URL, EMAIL_FROM, HIBP_KANON_API_TOKEN, and HIBP_API_TOKEN (Ask for values in #fx-monitor-engineering)
If you don't have a local FxA account, sign up on localhost. You'll need to ensure FXA_ENABLED=true and confirm/add the value for OAUTH_CLIENT_SECRET in your .env file. (Ask in #fx-monitor-engineering)
Subscribe with a Firefox Account is controlled via the FXA_ENABLED environment variable. (See .env-dist)
The repo comes with a development FxA oauth app pre-configured in .env, which should work fine running the app on http://localhost:6060. You'll need to get the OAUTH_CLIENT_SECRET value from someone in #fxmonitor-engineering.
The full test suite can be run via npm test.
To run individual tests, use NODE_ENV=tests and jest:
NODE_ENV=tests jest --runInBand tests/home.test.js
To run tests with interactive debugger lines enabled: