Skip to content

Commit

Permalink
change scraper URL and added dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mmt456 committed Jul 19, 2024
1 parent bd46f52 commit 165aad4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
14 changes: 14 additions & 0 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:16

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
COPY package*.json ./

RUN npm install
# Bundle app source
COPY . .

EXPOSE 3000
CMD [ "npm", "start" ]
5 changes: 4 additions & 1 deletion src/utils/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const ENV_API_URL: string = 'REACT_APP__API_URL';

export const SCRAPER_URL: string = '' +
(process.env['SCAPER_URL'] == null
? 'http://localhost:8000'
: process.env['SCRAPER_URL']);
/**
* The value should be:
* - When developing frontend only: 'https://coverage.seattlecommunitynetwork.org'.
Expand Down
4 changes: 2 additions & 2 deletions src/vis/MeasurementMap.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from 'react';
import { MapType } from './MapSelectionRadio';
import { API_URL } from '../utils/config';
import { SCRAPER_URL } from '../utils/config';
import * as L from 'leaflet';
import * as d3 from 'd3';
import * as parser from 'parse-address';
Expand Down Expand Up @@ -64,8 +65,7 @@ function searchEventHandler(result: any): void {

var postcode = result.location.raw.address.postcode;
var state = result.location.raw.address.state;
var endPoint = "http://127.0.0.1:8000/"; // server
var url = endPoint
var url = SCRAPER_URL // server "http://127.0.0.1:8000/"
+ "?state=" + state
+ "&cityname=" + city
+ "&primary=" + parsedAddr.number
Expand Down

0 comments on commit 165aad4

Please sign in to comment.