ui-router-server / prerender / redirectPage
Function: redirectPage()
ts
function redirectPage(line): string;Defined in: redirect-pages.ts:62
The default redirect page for one line: a location.replace that carries the request's query and fragment when the target has none of its own, a meta refresh and a plain link for browsers without script, a canonical link to the target, and noindex. The target is escaped in markup and script.
Parameters
| Parameter | Type | Description |
|---|---|---|
line | RedirectLine | the rules line; the page uses its to |
Returns
string
the page's HTML
Example
ts
import { redirectPage, redirectPages } from 'ui-router-server/prerender';
declare const analytics: string;
const rules = redirectPages({
page: (line) => redirectPage(line).replace('</head>', `${analytics}</head>`),
});