diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-10-24 12:22:03 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-10-24 12:22:03 +0100 |
commit | 831881eb967ec64f6c7131a9835114df7d40c29a (patch) | |
tree | 824dc7c2f3b09e794cb9d317a1be45da503027cf /perllib/FixMyStreet/App/Controller/FakeMapit.pm | |
parent | e12e5a7685b4ae5dcfeaf931adde2dbb91ef745f (diff) | |
parent | 3617fbf4ee622fce7961e4687d2a9b5c9312faa9 (diff) |
Merge branch 'reports-area-as-a-hole'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/FakeMapit.pm')
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/FakeMapit.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/FakeMapit.pm b/perllib/FixMyStreet/App/Controller/FakeMapit.pm index a4adadd09..0ec13ebfa 100755 --- a/perllib/FixMyStreet/App/Controller/FakeMapit.pm +++ b/perllib/FixMyStreet/App/Controller/FakeMapit.pm @@ -2,6 +2,7 @@ package FixMyStreet::App::Controller::FakeMapit; use Moose; use namespace::autoclean; use JSON::MaybeXS; +use LWP::Simple; BEGIN { extends 'Catalyst::Controller'; } @@ -21,6 +22,16 @@ world is one area, with ID 161 and name "Everywhere". my $area = { "name" => "Everywhere", "type" => "ZZZ", "id" => 161 }; +# The user should have the web server proxying this, +# but for development we can also do it on the server. +sub proxy : Path('/mapit') { + my ($self, $c) = @_; + (my $path = $c->req->uri->path_query) =~ s{^/mapit/}{}; + my $url = FixMyStreet->config('MAPIT_URL') . $path; + my $kml = LWP::Simple::get($url); + $c->response->body($kml); +} + sub output : Private { my ( $self, $c, $data ) = @_; my $body = encode_json($data); |