data


dataData

Sets or gets the data to pass with the response.

A data object to be used by the page routed to. The page routed to accesses the data passed to it using the getRouterData() function of wix-window-frontend with optional data and HTML header.

JavaScript
export function myRouter_Router(request) { let data = response.data; /* * { * "title": "A", * "imageSite": "https://static.wixstatic.com/media/", * "image": "b8f383e0fe2b478ea91362b707ef267b.jpg" * } */ }
Did this help?

head


headHeadOptions

Sets or gets the members to be written to the HTML head of the page.

The information you set using the head property, such as links or meta tags. Overwrites any head information set earlier.

The members of the head property value are written to the HTML head for use by browsers and SEO bots.

JavaScript
export function myRouter_Router(request) { let head = response.head; /* * { * "title": "A page title", * "metaTags": [ * { * "name": "description", * "content": "A page description" * }, { * "name": "keywords", * "content": "Velo Example" * }, { * "name": "robots", * "content": "noindex" * }, { * "name": "og:title", * "content": "The Title" * }, { * "property": "og:image", * "content": "wix:image://v1/6...2.jpg/a.jpg#originWidth=970&originHeight=120" * } * ], * "links": [ * { * "rel": "canonical", * "href": "http://mysite.com/somePage.html" * } * ], * "structuredData": [ * { * "@context": "http://schema.org", * "@type": "Organization", * "name": "My Organization Name", * "url": "https://www.myorgdomain.com" * }, { * "@context": "http://schema.org", * "@type": "Person", * "email": "mailto:john.doe@somedomain.com", * "jobTitle": "Professor", * "name": "John Doe", * "telephone": "(555) 555-555" * } * ] * } */
Did this help?

message


messagestring

Sets or gets the response message to be used when responding with status codes 4xx and 5xx.

JavaScript
export function myRouter_Router(request) { let message = response.message; // "Not found" }
Did this help?

page


pagestring

Sets or gets the page to route to.

JavaScript
export function myRouter_Router(request) { let page = response.page; // "myRouter-page" }
Did this help?

redirectUrl


redirectUrlstring

Sets or gets the url to redirect to when responding with status codes 301 and 302.

JavaScript
export function myRouter_Router(request) { let redirectUrl = response.redirectUrl; // "http://someothersite.com" }
Did this help?

status


statusnumber

Sets or gets the response's HTTP status code.

JavaScript
export function myRouter_Router(request) { let status = response.status; // 200 }
Did this help?