Skip to main content
Table of contents

Routing

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
govukcli set-context production-aws
govukcli ssh router_backend
  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 on 5 September 2019. It needs to be reviewed again on 5 March 2020 by the page owner #govuk-2ndline .
This page was set to be reviewed before 5 March 2020 by the page owner #govuk-2ndline. This might mean the content is out of date.