mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 00:23:53 +00:00
docs: use ts for create-error example (#28411)
This commit is contained in:
parent
c906312034
commit
576c34efe9
@ -41,7 +41,7 @@ Use `createError` to trigger error handling in server API routes.
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```js
|
```ts [server/api/error.ts]
|
||||||
export default eventHandler(() => {
|
export default eventHandler(() => {
|
||||||
throw createError({
|
throw createError({
|
||||||
statusCode: 404,
|
statusCode: 404,
|
||||||
|
Loading…
Reference in New Issue
Block a user