mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 22:55:13 +00:00
3ec108493d
* docs: simplify docs to only markdown * Create nuxt-config.md * chore: update * chore: add readme
661 B
661 B
description |
---|
setResponseStatus sets the statusCode (and optionally the statusMessage) of the response. |
setResponseStatus
Nuxt provides composables and utilities for first-class server-side-rendering support.
setResponseStatus
sets the statusCode (and optionally the statusMessage) of the response.
setResponseStatus
can only be called within component setup functions, plugins, and route middleware.
// Set the status code to 404 for a custom 404 page
setResponseStatus(404)
// Set the status message as well
setResponseStatus(404, 'Page Not Found')
::alert{icon=👉}
In the browser, setResponseStatus
will have no effect.
::