Type Method
redirect(to:type:)
Creates a redirecting
Abort error.static func redirect(to location: String, type: RedirectType) -> Abort
Parameters
locationThe path to redirect to
typeThe type of redirect to perform
Return Value
An abort error that provides a redirect to the specified location
Discussion
throw Abort.redirect(to: "https://vapor.codes")"
Set type to ‘.permanently’ to allow caching to automatically redirect from browsers. Defaulting to non-permanent to prevent unexpected caching.