MAPC / massbuilds

Crowdsourcing authoritative info on recent & ongoing developments in Massachusetts.
https://www.massbuilds.com/
2 stars 2 forks source link

Add DataCommon to accepted_hosts #280

Closed atomtay closed 4 years ago

atomtay commented 4 years ago

Describe the feature. What should a user be able to do? Currently, the only known hosts that are allowed to make API requests (as laid out in /rails/config/application.rb) are as follows:

known_hosts = [
      'http://localhost:4200',
      'https://staging.massbuilds.com',
      'https://massbuilds.com',
      'https://www.massbuilds.com',
    ]

We should add https://datacommon.mapc.org and https://staging.datacommon.mapc.org to this list so that visualizations from that site can request Massbuilds data.

Why do we need this feature? We're looking at a MassBuilds feature for the March 2020 calendar visualization, and while I can make local requests by setting up my development environment on port 4200 (may also be worth adding localhost:3000 if there isn't a pressing reason not to, since that's the default Rails port), any API calls will fail as soon as it goes to staging or production.

Alternatives We can download the data from MassBuilds, host it within DataCommon, and then call the local copy in the visualization.