Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submission to Implement Frontend for usaddress API call #43

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

charles-threlkeld
Copy link

Overview

This pull links the form template front-end to the API for parsing addresses.

Also, closes #38.

Demo

On success, a table is populated with the information:

parserator-success

On failure, an alert is generated and the table is cleared:

parserator-failure

Notes

Note that the url is currently hard-coded into parserator_web/static/js/index.js as localhost:8000.

Http responses other than 200 (success) and 400 (parse failure) are not handled.

No text processing was done on the field names of the addresses, so they are still in CamelCase, which isn't particularly user friendly for a front end.

Testing Instructions

  • docker-compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app
  • Successful case: 123 main st chicago il returns status code 200 and json:
{"address_components": [["AddressNumber", "123"],
                        ["StreetName", "main"],
                        ["StreetNamePostType", "st"],
                        ["PlaceName", "chicago"],
                        ["StateName", "il"]],
 "address_type": "Street Address",
 "input_string": "123 main st chicago il"}
  • Unsuccessful case 123 main st chicago il 123 main st returns status code 400 and json:
{"error": "This address failed to parse"}

tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm issue when running 'compose build'
1 participant