Backend services for the We the Users campaign
npm install
gulp runServer
The server should now be running at 127.0.0.1:3200 by default
App configuration is controlled using the node-config module
The JSON files containing configuration are all under /config. Production configuration mostly uses the JSON files, with a couple of heroku specific vars picked up via environment variables.
Creates a new signature object on the server and queues it for processing via the We The People API
See the signaturePOSTSchema object for the Joi schema definition
- firstName (required) - The first name of the petition signatory
- lastName (required) - The last name of the petition signatory
- email (required) - The email address of the petition signatory, required to validate their signature
- subscribeToEmails (required) - The short code (EFF, FFTF etc.) of the organization the wants to join the mailing list of
An object with the following keys and values:
- status - The request's status, should always be success
Request
POST http://127.0.0.1:3200/api/1/signatures
Return
{
"status": "success"
}
Fetches the signature object matching the supplied email
See the signatureGETSchema object for the Joi schema definition
- email (required) - The email address of the signatory whose signature should be fetched
An object with the following keys and values:
- firstName - The first name of the petition signatory
- lastName - The last name of the petition signatory
- email - The email address of the petition signatory, required to validate their signature
- subscribeToEmails - The short code (EFF, FFTF etc.) of the organization the wants to join the mailing list of
- isValidated - Whether the signature has been validated
- sentToWhiteHouse - Whether the request has been dispatched to the WTP API
Request
GET http://127.0.0.1:3200/api/1/signatures/test%40test.com
Return
{
"firstName": "Leah",
"lastName": "Jones",
"email": "[email protected]",
"subscribeToEmails": "EFF",
"isValidated": false,
"sentToWhiteHouse": true
}