Table of contents

Edit an existing route in the Router

The Router API database is populated from the Publishing API, and also the deprecated router-data tool. Changes to routes should be made in the Publishing API as this is the authoritative source of the data, however, it can be helpful to make short term changes to routes manually, when going through the Publishing API would take too long, for example during an incident.

If there’s a need to edit a route in the database:

  1. Connect to a router-backend machine
ssh router-backend-1.router.production

in Carrenza, and

govukcli set-context integration
govukcli ssh router_backend

in AWS.

  1. Connect to router-api and get the route
govuk_app_console router-api
> r = Route.where(incoming_path: '/path-to-item').first
  1. Manipulate the r object directly (see the documentation for available options), for example:
> r.route_type = 'exact'
> r.save!
  1. Once you’ve edited the route appropriately and saved it, reload the router
> RouterReloader.reload
This page was last reviewed . It needs to be reviewed again by the page owner #govuk-2ndline.