namespace :router do
  task :router_environment => :environment do
    require 'plek'
    require 'gds_api/router'

    @router_api = GdsApi::Router.new(Plek.current.find('router-api'))
  end

  task :register_backend => :router_environment do
    @router_api.add_backend('contacts-frontend', Plek.current.find('contacts-frontend', :force_http => true) + "/")
  end

  task :register_routes => :router_environment do
    @router_api.add_route('/contact/hm-revenue-customs', 'prefix', 'contacts-frontend')
  end

  desc "Register Contacts application and routes with the router"
  task :register => [ :register_backend, :register_routes ]
end

namespace :router do
  task :router_environment => :environment do
    require 'plek'
    require 'gds_api/router'

    @router_api = GdsApi::Router.new(Plek.current.find('router-api'))
  end

  task :register_backend => :router_environment do
    @router_api.add_backend('contacts-frontend-old', Plek.current.find('contacts-frontend-old', :force_http => true) + "/")
  end

  task :register_routes => :router_environment do
    @router_api.add_route('/contact/hm-revenue-customs', 'prefix', 'contacts-frontend-old')
  end

  desc "Register Contacts application and routes with the router"
  task :register => [ :register_backend, :register_routes ]
end

Update route registration to reflect new vhost
Update route registration to reflect new vhost

The frontend part of the app is currently listening on 2 vhosts -
contacts-frontend and contacts-frontend-old.  Before long the former
will be reclaimed for the new frontend app, so the routes need to be
pointed at the latter.
