Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ jspm_packages

# webpack
.webpack

.env
newrelic_agent.log
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
run:
sls offline start --port 4500 --dontPrintOutput

test:
perl test.pl

deps:
yarn install
npm -g install serverless

deploy-dev:
sls deploy --stage dev

deploy-prod:
sls deploy --stage prod

.PHONY: run test deps
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,25 @@

National Voting Registration Imaging Service

### to Deploy
### Deployment

1. Set up Serverless framework. https://serverless.com/framework/docs/providers/aws/guide/quick-start/
2. From within project folder run `sls deploy --stage dev` (replace stage name as necessary)
2. Verify that your ~/.aws/credentials profile is named "nvris-dev" for your AWS IAM creds.
3. From within project folder run `sls deploy --stage dev` (replace stage name as necessary)

### Usage

```
curl -XPOST -H 'Content-Type: application/json' --data @exampleFlexPayload.json the-nvris-url/vr/en
```

## On OSX

Ensure you are using the latest freetype and imagemagick.

```
brew update
brew upgrade freetype
brew upgrade imagemagick
```

54 changes: 54 additions & 0 deletions newrelic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
'use strict'
/**
* New Relic agent configuration.
*
* See lib/config/default.js in the agent distribution for a more complete
* description of configuration variables and their potential values.
*/
exports.config = {
/**
* Array of application names.
*/
app_name: [process.env.NEW_RELIC_APP_NAME],
/**
* Your New Relic license key.
*/
license_key: process.env.NEW_RELIC_LICENSE_KEY,
logging: {
/**
* Level at which to log. 'trace' is most useful to New Relic when diagnosing
* issues with the agent, 'info' and higher will impose the least overhead on
* production applications.
*/
level: 'info',
filepath: 'stdout'
},
/**
* When true, all request headers except for those listed in attributes.exclude
* will be captured for all traces, unless otherwise specified in a destination's
* attributes include/exclude lists.
*/
allow_all_headers: true,
attributes: {
/**
* Prefix of attributes to exclude from all destinations. Allows * as wildcard
* at end.
*
* NOTE: If excluding headers, they must be in camelCase form to be filtered.
*
* @env NEW_RELIC_ATTRIBUTES_EXCLUDE
*/
exclude: [
'request.headers.cookie',
'request.headers.authorization',
'request.headers.proxyAuthorization',
'request.headers.setCookie*',
'request.headers.x*',
'response.headers.cookie',
'response.headers.authorization',
'response.headers.proxyAuthorization',
'response.headers.setCookie*',
'response.headers.x*'
]
}
}
Loading