Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.06 KB

README.md

File metadata and controls

27 lines (18 loc) · 1.06 KB

Lob api demo

A demo application built on Node.js that prompts the user for input on stdin and creates a letter to a state representative using the Lob api. Given the address of the user, we get the corresponding state representative's details from the Google Civic Api

Getting started

The project was built on the the latest stable version of node.js v8.9.1 Make sure to have switched to Node 8 before executing the program.

The link to the output file is printed on the stdout. Any errors are also printed to stdout.

Installation

  1. cd into the project location
  2. npm i to install dependencies

Setup

  1. You need a Google API key that is enabled for the Google Civic Information API
  2. Add your Google API key as an environment variable with the name GOOGLE_API_KEY. Run export GOOGLE_API_KEY=YOUR_API_KEY
  3. OR you can also pass the API key as a command line argument.

Running the program

  1. Run node index.js to start the program.
  2. Run node index.js YOUR_API_KEY to pass the API key via command line