diff --git a/Dockerfile b/Dockerfile index 4c464fdf..da1d522a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,12 @@ RUN pip install --no-cache-dir -r requirements.txt # Install Node requirements COPY ./package.json /app/package.json -RUN npm install + +#this process errored out +#RUN npm install + +# i used this one instead +RUN apt-get install npm -y # Copy the contents of the current host directory (i.e., our app code) into # the container. diff --git a/parserator_web/views.py b/parserator_web/views.py index 0be3f4a9..a3c87f3b 100644 --- a/parserator_web/views.py +++ b/parserator_web/views.py @@ -16,9 +16,15 @@ class AddressParse(APIView): def get(self, request): # TODO: Flesh out this method to parse an address string using the # parse() method and return the parsed components to the frontend. - return Response({}) + address_components, address_type = self.parse(request.data.address) + return Response({"input_string" : request.data.address, + "address_components" : address_components, + "address_type" : address_type}) + def parse(self, address): # TODO: Implement this method to return the parsed components of a # given address using usaddress: https://github.com/datamade/usaddress + address_components, address_type = usaddress.tag(address) return address_components, address_type +