From 4a4c01a61ceb5d80cf71e731e5f51f561ff3b0f1 Mon Sep 17 00:00:00 2001 From: Gerome Grignon Date: Fri, 4 Oct 2024 01:23:21 +0200 Subject: [PATCH] docs(tasks): server is the default tasks folder --- docs/1.guide/10.tasks.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/1.guide/10.tasks.md b/docs/1.guide/10.tasks.md index a744ead52f..c04d433f17 100644 --- a/docs/1.guide/10.tasks.md +++ b/docs/1.guide/10.tasks.md @@ -37,13 +37,13 @@ export default defineNuxtConfig({ ## Define tasks -Tasks can be defined in `tasks/[name].ts` files. +Tasks can be defined in `server/tasks/[name].ts` files. -Nested directories are supported. The task name will be joined with `:`. (Example: `tasks/db/migrate.ts`task name will be `db:migrate`) +Nested directories are supported. The task name will be joined with `:`. (Example: `server/tasks/db/migrate.ts`task name will be `db:migrate`) **Example:** -```ts [tasks/db/migrate.ts] +```ts [server/tasks/db/migrate.ts] export default defineTask({ meta: { name: "db:migrate", @@ -56,10 +56,6 @@ export default defineTask({ }); ``` -> [!NOTE] -> Use `server/tasks/db/migrate.ts` for Nuxt. - - ## Scheduled tasks You can define scheduled tasks using Nitro configuration to automatically run after each period of time. @@ -150,7 +146,7 @@ This endpoint returns a list of available task names and their meta. This endpoint executes a task. You can provide a payload using both query parameters and body JSON payload. The payload sent in the JSON body payload must be under the `"payload"` property. ::code-group -```ts [tasks/echo/payload.ts] +```ts [server/tasks/echo/payload.ts] export default defineTask({ meta: { name: "echo:payload",