File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,20 @@ sub _set_up_routes {
145145 $self -> plugin( ' Minion::Admin' => { route => $admin -> any(' /minion' ) } );
146146 $self -> plugin(
147147 ' OpenAPI' => { url => $self -> home-> rel_file(' root/static/v1.yml' ) } );
148+
149+ # This route is for when nginx gets updated to no longer strip the `/v1` path.
150+ # By retaining the `/v1` path the OpenAPI spec is picked up and passed
151+ # through Mojolicous. The `rewrite` parameter is stripping the `/v1` before
152+ # it is passed to Catalyst allowing the previous logic to be followed.
153+ $self -> plugin(
154+ MountPSGI => {
155+ ' /v1' => $self -> home-> child(' app.psgi' )-> to_string,
156+ rewrite => 1
157+ }
158+ );
159+
160+ # XXX Catch cases when `v1` has been stripped by nginx until migration is complete
161+ # XXX then this path can be removed.
148162 $self -> plugin(
149163 MountPSGI => { ' /' => $self -> home-> child(' app.psgi' )-> to_string } );
150164
You can’t perform that action at this time.
0 commit comments