sendStatus( )


Returns a response with the specified HTTP status code with an optional message.

The sendStatus() function is used in the router(), beforeRouter(), and afterRouter() hooks to return a specified response. Optionally, you can pass a message.

Method Declaration
Copy
Method Parameters
statusCodestringRequired

The HTTP status code to return.


messagestring

The message to write as the HTTP body.

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