- CLAUDE.md 운영 규칙 - wiki/ 정리된 지식 페이지 (Nuxt + Claude Code) - raw/ 원본 자료 - reference/ Nuxt 4.x 공식 문서 Co-authored-by: Cursor <cursoragent@cursor.com>
999 B
999 B
title, description, links
| title | description | links | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| setResponseStatus | setResponseStatus sets the status (and optionally the statusText) of the response. |
|
Nuxt provides composables and utilities for first-class server-side-rendering support.
setResponseStatus sets the status (and optionally the statusText) of the response.
::important
setResponseStatus can only be called in the Nuxt context.
::
const event = useRequestEvent()
// event will be undefined in the browser
if (event) {
// Set the status code to 404 for a custom 404 page
setResponseStatus(event, 404)
// Set the status message as well
setResponseStatus(event, 404, 'Page Not Found')
}
::note
In the browser, setResponseStatus will have no effect.
::
:read-more{to="/docs/4.x/getting-started/error-handling"}