ok( )


Returns a response with a status code 200 (OK) and instructs the router to show the selected page.

The ok() function is used in the router() and afterRouter() hooks to continue the routing process to the specified page with a successful HTTP response code. The specified page must be a page found under the given router in the Velo Sidebar. For example, if you want to route to myRouter-page from the myRouter_Router() function, myRouter-page must be in the MyRouter Pages (Router) section of your site's Velo Sidebar.

Optionally, you can pass a data object to be used by the page routed to and header options for the page. The page routed to accesses the data passed to it using the getRouterData() function of wix-window-frontend with optional data and HTML header.

Method Declaration
Copy
Method Parameters
PagestringRequired

A router page or an array of page fallbacks.


routerReturnedDataobject

A data object.


headHeadOptions

HTML head members of the response.

Returns
Return Type:Promise<WixRouterResponse>
Was this helpful?
Yes
No