diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index fb5142e918..1748aa1927 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -58,6 +58,7 @@ const sidebar = { title: 'Optional configurations', collapsable: true, children: [ + ['/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', 'API tokens'], ['/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', 'Functions'], ['/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', 'Cron jobs'], ['/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', 'API'], @@ -198,72 +199,6 @@ const sidebar = { initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default sidebarDepth: 2, children: [ - { - title: 'Integrations', - path: '/developer-docs/latest/developer-resources/content-api/integrations.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', - 'Vue.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/angular', - 'Angular', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/next-js', - 'Next.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', - 'Nuxt.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/graphql', - 'GraphQL', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', - 'Gatsby', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', - 'Gridsome', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', - 'Jekyll', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/svelte', - 'Svelte', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/sapper', - 'Sapper', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/python', - 'Python', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/flutter', - 'Flutter', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], - ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/laravel', - 'Laravel', - ], - ], - }, { title: 'APIs Reference', collapsable: true, @@ -338,6 +273,72 @@ const sidebar = { }, ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], + { + title: 'Integrations', + path: '/developer-docs/latest/developer-resources/content-api/integrations.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', + 'Vue.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/angular', + 'Angular', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/next-js', + 'Next.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', + 'Nuxt.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/graphql', + 'GraphQL', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', + 'Gatsby', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', + 'Gridsome', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', + 'Jekyll', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/svelte', + 'Svelte', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/sapper', + 'Sapper', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/python', + 'Python', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/flutter', + 'Flutter', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], + ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/laravel', + 'Laravel', + ], + ], + }, ], }, { @@ -345,24 +346,23 @@ const sidebar = { collapsable: true, children: [ ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], - // ['/developer-docs/latest/guides/count-graphql', 'Count with GraphQL'], - ['/developer-docs/latest/guides/slug', 'Create a slug system'], - ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], - ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], - ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], + // ['/developer-docs/latest/guides/slug', 'Create a slug system'], + // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], + // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], + // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], ['/developer-docs/latest/guides/draft', 'Draft system'], - ['/developer-docs/latest/guides/error-catching', 'Error catching'], - ['/developer-docs/latest/guides/external-data', 'Fetching external data'], + // ['/developer-docs/latest/guides/error-catching', 'Error catching'], + // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], ['/developer-docs/latest/guides/process-manager', 'Process manager'], ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], - ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], - ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], - [ - '/developer-docs/latest/guides/registering-a-field-in-admin', - 'Registering a new field in the admin panel', - ], - ['/developer-docs/latest/guides/client', 'Setup a third party client'], + // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], + // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], + // [ + // '/developer-docs/latest/guides/registering-a-field-in-admin', + // 'Registering a new field in the admin panel', + // ], + // ['/developer-docs/latest/guides/client', 'Setup a third party client'], ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], ], }, @@ -499,6 +499,7 @@ const plugins = [ siteTitle: (_, $site) => $site.title, title: $page => $page.title, }], + ['@vuepress/medium-zoom'], ['vuepress-plugin-code-copy', { color: '#ffffff', successText: 'Copied to clipboard!', diff --git a/docs/developer-docs/latest/assets/quick-start-guide/icons/content.svg b/docs/developer-docs/latest/assets/quick-start-guide/icons/content.svg new file mode 100644 index 0000000000..8a0a129bd2 --- /dev/null +++ b/docs/developer-docs/latest/assets/quick-start-guide/icons/content.svg @@ -0,0 +1,3 @@ + + + diff --git a/docs/developer-docs/latest/assets/quick-start-guide/icons/content_types_builder.svg b/docs/developer-docs/latest/assets/quick-start-guide/icons/content_types_builder.svg new file mode 100644 index 0000000000..dafef5a82f --- /dev/null +++ b/docs/developer-docs/latest/assets/quick-start-guide/icons/content_types_builder.svg @@ -0,0 +1,3 @@ + + + diff --git a/docs/developer-docs/latest/assets/quick-start-guide/icons/plugins.svg b/docs/developer-docs/latest/assets/quick-start-guide/icons/plugins.svg new file mode 100644 index 0000000000..a0cc58cb62 --- /dev/null +++ b/docs/developer-docs/latest/assets/quick-start-guide/icons/plugins.svg @@ -0,0 +1,3 @@ + + + diff --git a/docs/developer-docs/latest/assets/quick-start-guide/icons/settings.svg b/docs/developer-docs/latest/assets/quick-start-guide/icons/settings.svg new file mode 100644 index 0000000000..cb76e89f86 --- /dev/null +++ b/docs/developer-docs/latest/assets/quick-start-guide/icons/settings.svg @@ -0,0 +1,3 @@ + + + diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-categories.gif b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-categories.gif index 5fa003b2ec..2ea31ea839 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-categories.gif and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-categories.gif differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part1-01-admin_panel.png b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part1-01-admin_panel.png index cd5b8031da..753f32922e 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part1-01-admin_panel.png and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part1-01-admin_panel.png differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-02-collection_ct.png b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-02-collection_ct.png index 7f24b76419..e05786b074 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-02-collection_ct.png and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-02-collection_ct.png differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-03-restaurant.png b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-03-restaurant.png index 910b5fa6e3..b57c35780f 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-03-restaurant.png and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-03-restaurant.png differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-04-roles.png b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-04-roles.png index 2a43f7f21f..2a6a9ebb31 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-04-roles.png and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-part2-04-roles.png differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-publish.gif b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-publish.gif index adb5ecab8e..86eb457ebf 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-publish.gif and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-publish.gif differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-restaurant.gif b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-restaurant.gif index 9df1bb9fb5..643b2d7735 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-restaurant.gif and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-handson-restaurant.gif differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part1-01-gatsby_fe.png b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part1-01-gatsby_fe.png deleted file mode 100644 index ec9d4b4a60..0000000000 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part1-01-gatsby_fe.png and /dev/null differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part1-01-next_fe.png b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part1-01-next_fe.png new file mode 100644 index 0000000000..3311d80571 Binary files /dev/null and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part1-01-next_fe.png differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part1-01-register.png b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part1-01-register.png index 02425f3b46..16ac627555 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part1-01-register.png and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part1-01-register.png differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-01-writer.png b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-01-writer.png index 184dac5718..77796b622c 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-01-writer.png and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-01-writer.png differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-03-write_publish_article.gif b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-03-write_publish_article.gif index dda559f75e..0f9903f7a6 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-03-write_publish_article.gif and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-03-write_publish_article.gif differ diff --git a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-04-restart_servers.gif b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-04-restart_servers.gif index 46866daac6..a2782f9be4 100644 Binary files a/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-04-restart_servers.gif and b/docs/developer-docs/latest/assets/quick-start-guide/qsg-starters-part2-04-restart_servers.gif differ diff --git a/docs/developer-docs/latest/concepts/draft-and-publish.md b/docs/developer-docs/latest/concepts/draft-and-publish.md index 2f4c9c9ead..c9a5b9e256 100644 --- a/docs/developer-docs/latest/concepts/draft-and-publish.md +++ b/docs/developer-docs/latest/concepts/draft-and-publish.md @@ -1,6 +1,7 @@ --- -title: Draft and publish - Strapi Developer Documentation +title: Draft and publish - Strapi Developer Docs description: The draft and publish feature allows you to save your content as a draft, to publish it later. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/concepts/draft-and-publish.html --- # Draft and publish diff --git a/docs/developer-docs/latest/developer-resources/cli/CLI.md b/docs/developer-docs/latest/developer-resources/cli/CLI.md index 3dfa234476..3b708fb591 100644 --- a/docs/developer-docs/latest/developer-resources/cli/CLI.md +++ b/docs/developer-docs/latest/developer-resources/cli/CLI.md @@ -1,6 +1,7 @@ --- -title: CLI - Strapi Developer Documentation +title: CLI - Strapi Developer Docs description: Strapi comes with a full featured Command Line Interface (CLI) which lets you scaffold and manage your project in seconds. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/cli.html --- # Command Line Interface (CLI) diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations.md b/docs/developer-docs/latest/developer-resources/content-api/integrations.md index 19facc7cf6..bce05fa668 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations.md @@ -1,6 +1,7 @@ --- -title: Integrations - Strapi Developer Documentation +title: Integrations - Strapi Developer Docs description: Integrate Strapi with a multitude of frameworks, frontend or backend programming languages. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations.html --- # Integrations diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/11ty.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/11ty.md index fb10c071a6..0956ba0b87 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/11ty.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/11ty.md @@ -1,10 +1,13 @@ --- -title: Get started with 11ty - Strapi Developer Documentation +title: Get started with 11ty - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless CMS and 11ty. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/11ty.html --- # Getting Started with 11ty +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [11ty](https://www.11ty.dev/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/angular.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/angular.md index ccc393a4f4..4e498cb90e 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/angular.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/angular.md @@ -1,10 +1,13 @@ --- -title: Get started with Angular - Strapi Developer Documentation +title: Get started with Angular - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Angular. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/angular.html --- # Getting Started with Angular +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Angular](https://angular.io) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/dart.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/dart.md index 0aa6f55389..fa01ff32f5 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/dart.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/dart.md @@ -1,10 +1,13 @@ --- -title: Get started with Dart - Strapi Developer Documentation +title: Get started with Dart - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Dart. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/dart.html --- # Getting Started with Dart +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Dart](https://dart.dev/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/flutter.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/flutter.md index 2ab5c5c72d..8d710f6186 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/flutter.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/flutter.md @@ -1,10 +1,13 @@ --- -title: Get started with Flutter - Strapi Developer Documentation +title: Get started with Flutter - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Flutter. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/flutter.html --- # Getting Started with Flutter +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Flutter](https://flutter.dev/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/gatsby.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/gatsby.md index 6ae1bd3d1d..b695ddc938 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/gatsby.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/gatsby.md @@ -1,10 +1,13 @@ --- -title: Get started with Gatsby - Strapi Developer Documentation -description: Build powerful applications using Strapi, the leading open-source headless cms and Gatsby. +title: Get started with Gatsby - Strapi Developer Docs +description: Build powerful applications using Strapi, the leading open-source headless CMS and Gatsby. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/gatsby.html --- # Getting Started with Gatsby +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Gatsby](https://www.gatsbyjs.org/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/go.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/go.md index aee335b6b5..71161d25fd 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/go.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/go.md @@ -1,10 +1,13 @@ --- -title: Get started with Go - Strapi Developer Documentation +title: Get started with Go - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Go. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/go.html --- # Getting Started with GO +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start guide, the way you request a Strapi API with [GO](https://golang.org/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/graphql.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/graphql.md index 0e69d78b80..14a73e0e7c 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/graphql.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/graphql.md @@ -1,10 +1,13 @@ --- -title: Get started with GraphQL - Strapi Developer Documentation +title: Get started with GraphQL - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and GraphQL. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/graphql.html --- # Getting Started with GraphQL +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [GraphQL](https://graphql.org/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/gridsome.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/gridsome.md index ecc34d9b20..aeae545cb6 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/gridsome.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/gridsome.md @@ -1,10 +1,13 @@ --- -title: Get started with Gridsome - Strapi Developer Documentation +title: Get started with Gridsome - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Gridsome. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/gridsome.html --- # Getting Started with Gridsome +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Gridsome](https://gridsome.org/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/jekyll.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/jekyll.md index fdf464c649..2425182c60 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/jekyll.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/jekyll.md @@ -1,10 +1,13 @@ --- -title: Get started with Jekyll - Strapi Developer Documentation +title: Get started with Jekyll - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Jekyll. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/jekyll.html --- # Getting Started with Jekyll +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Jekyll](https://jekyllrb.com) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/laravel.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/laravel.md index b22e090a03..2a3ee734d4 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/laravel.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/laravel.md @@ -1,10 +1,13 @@ --- -title: Get started with Laravel - Strapi Developer Documentation +title: Get started with Laravel - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Laravel. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/laravel.html --- # Getting Started with Laravel +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). Should you wish to use standalone PHP, you may also be interested in the [PHP integration guide](/developer-docs/latest/developer-resources/content-api/integrations/php.md). diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/next-js.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/next-js.md index 577fda3f19..39da8dec14 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/next-js.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/next-js.md @@ -1,10 +1,13 @@ --- -title: Get started with Next.js - Strapi Developer Documentation +title: Get started with Next.js - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Next.js. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/next-js.html --- # Getting Started with Next.js +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Next.js](https://nextjs.org/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js.md index aa14f9d3fb..33afacfc16 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js.md @@ -1,10 +1,13 @@ --- -title: Get started with Nuxt.js - Strapi Developer Documentation +title: Get started with Nuxt.js - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Nuxt.js. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js.html --- # Getting Started with Nuxt.js +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Nuxt.js](https://nuxtjs.org/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/php.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/php.md index f3c325dc17..64890ee0a6 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/php.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/php.md @@ -1,10 +1,13 @@ --- -title: Get started with PHP - Strapi Developer Documentation +title: Get started with PHP - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and PHP. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/php.html --- # Getting Started with PHP +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [PHP](https://php.net/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/python.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/python.md index efb51cb736..cee8de5b20 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/python.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/python.md @@ -1,10 +1,13 @@ --- -title: Get started with Python - Strapi Developer Documentation +title: Get started with Python - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Python. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/python.html --- # Getting Started with Python +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Python](https://www.python.org/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/react.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/react.md index ca31b54d93..bb9fba99be 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/react.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/react.md @@ -1,10 +1,13 @@ --- -title: Get started with React - Strapi Developer Documentation +title: Get started with React - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and React. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/react.html --- # Getting Started with React +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [React](https://reactjs.org/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/ruby.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/ruby.md index d071c91c1f..e0e3f65df9 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/ruby.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/ruby.md @@ -1,10 +1,13 @@ --- -title: Get started with Ruby - Strapi Developer Documentation +title: Get started with Ruby - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Ruby. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/ruby.html --- # Getting Started with Ruby +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Ruby](https://www.ruby-lang.org/en/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/sapper.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/sapper.md index bddb730984..37dfc11601 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/sapper.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/sapper.md @@ -1,10 +1,13 @@ --- -title: Get started with Sapper - Strapi Developer Documentation +title: Get started with Sapper - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Sapper. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/sapper.html --- # Getting Started with Sapper +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Sapper](https://sapper.svelte.dev) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/svelte.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/svelte.md index 3f6a630c77..ab7ad6f433 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/svelte.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/svelte.md @@ -1,10 +1,13 @@ --- -title: Get started with Svelte - Strapi Developer Documentation +title: Get started with Svelte - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Svelte. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/svelte.html --- # Getting Started with Svelte +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Svelte](https://svelte.dev) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/integrations/vue-js.md b/docs/developer-docs/latest/developer-resources/content-api/integrations/vue-js.md index 51ed7c88a4..10b811caef 100644 --- a/docs/developer-docs/latest/developer-resources/content-api/integrations/vue-js.md +++ b/docs/developer-docs/latest/developer-resources/content-api/integrations/vue-js.md @@ -1,10 +1,13 @@ --- -title: Get started with Vue.js - Strapi Developer Documentation +title: Get started with Vue.js - Strapi Developer Docs description: Build powerful applications using Strapi, the leading open-source headless cms and Vue.js. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/content-api/integrations/vue-js.html --- # Getting Started with Vue.js +!!!include(developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md)!!! + This integration guide is following the [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md). We assume that you have fully completed its "Hands-on" path, and therefore can consume the API by browsing this [url](http://localhost:1337/restaurants). If you haven't gone through the Quick Start Guide, the way you request a Strapi API with [Vue.js](https://vuejs.org/) remains the same except that you will not fetch the same content. diff --git a/docs/developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md b/docs/developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md new file mode 100644 index 0000000000..51659b8bb0 --- /dev/null +++ b/docs/developer-docs/latest/developer-resources/content-api/snippets/integration-guide-not-updated.md @@ -0,0 +1,3 @@ +::: caution +This third-party integration guide might not be up-to-date with Strapi v4. [Contributions](https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md) are most welcome. +::: diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.md index 7d5701b960..ab84ec8aec 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.md @@ -1,10 +1,9 @@ --- -title: Entity Service API - Strapi Developer Documentation -description: … +title: Entity Service API - Strapi Developer Docs +description: The Entity Service is the layer that handles Strapi's complex data structures like components and dynamic zones, and uses the Query Engine API under the hood to execute database queries. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.html --- - - # Entity Service API Strapi provides an Entity Service API, built on top of the [Query Engine API](/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.md). The Entity Service is the layer that handles Strapi's complex data structures like [components](/developer-docs/latest/development/backend-customization/models.md#components-2) and [dynamic zones](/developer-docs/latest/development/backend-customization/models.md#dynamic-zones), and uses the Query Engine API under the hood to execute database queries. diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md index 395137ed91..0fb30dd8a8 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md @@ -1,10 +1,9 @@ --- -title: Filtering with Entity Service API - Strapi Developer Documentation -description: … +title: Components and Dynamic Zones with Entity Service API - Strapi Developer Docs +description: Use Strapi's Entity Service to create and update components and dynamic zones. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.html --- - - # Entity Service API: Components and dynamic zones The [Entity Service](/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.md) is the layer that handles [components](/developer-docs/latest/development/backend-customization/models.md#components-2) and [dynamic zones](/developer-docs/latest/development/backend-customization/models.md#dynamic-zones) logic. With the Entity Service API, components and dynamic zones can be [created](#creation) and [updated](#update) while creating or updating entries. diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md index 756ab16699..61dead7b9d 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md @@ -1,10 +1,9 @@ --- title: CRUD operations with Entity Service API - Strapi Developer Docs -description: … +description: Use Strapi's Entity Service API to perform CRUD (create, read, update, delete) operations on your content. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.html --- - - # Entity Service API: CRUD operations The [Entity Service API](/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.md) is built on top of the the [Query Engine API](/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.md) and uses it to perform CRUD operations on entities. diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md index e46679103c..dd597a1ff6 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md @@ -1,11 +1,10 @@ --- -title: Entity Service API - Filtering - Strapi Developer Documentation -description: Filter, order and paginate results with Entity Service API +title: Filtering with Entity Service API - Strapi Developer Docs +description: Use Strapi's Entity Service API to filter your queries results. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.html --- - - # Entity Service API: Filtering The [Entity Service API](/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.md) offers the ability to filter results found with its [findMany()](/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md#findmany) method. diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md index 325f35d0e7..d106259204 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md @@ -1,8 +1,8 @@ --- -title: Entity Service API - Ordering & Pagination - Strapi Developer Documentation -description: (add description here) +title: Ordering & Pagination with Entity Service API - Strapi Developer Docs +description: Use Strapi's Entity Service API to order and paginate queries results. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.html --- - # Entity Service API: Ordering & Pagination diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md index 4ea511e337..b2bb8716d7 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md @@ -1,8 +1,8 @@ --- -title: Entity Service API - Populating - Strapi Developer Documentation -description: (add description here) +title: Entity Service API - Populating - Strapi Developer Docs +description: Use Strapi's Entity Service API to populate relations in your queries. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.html --- - # Entity Service API: Populating diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md index 6d012cd59b..5eb5361f13 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md @@ -1,9 +1,9 @@ --- -title: GraphQL API - Strapi Developer Documentation +title: GraphQL API - Strapi Developer Docs description: Use a GraphQL endpoint in your Strapi project to fetch and mutate your content. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.html --- - # GraphQL API diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.md index de74d450ac..44ff4cee2a 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.md @@ -1,8 +1,8 @@ --- -title: Query Engine API - Strapi Developer Documentation -description: (add description here) +title: Query Engine API - Strapi Developer Docs +description: Strapi provides a Query Engine API to give unrestricted internal access to the database layer at a lower level. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html --- - # Query Engine API diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md index ee2bea5f85..df660965dd 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md @@ -1,8 +1,8 @@ --- -title: Single Operations for Query Engine API - Strapi Developer Documentation -description: (add description here) +title: Bulk Operations for Query Engine API - Strapi Developer Docs +description: Use Strapi's Query Engine API to perform operations on multiple entries. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.html --- - # Query Engine API: Bulk Operations diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md index 9acb5e85b8..79f450420e 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md @@ -1,9 +1,10 @@ --- -title: Filtering Operations for Query Engine API - Strapi Developer Documentation -description: (add description here) +title: Filtering Operations for Query Engine API - Strapi Developer Docs +description: Use Strapi's Query Engine API to filter the results of your queries. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.html --- - + # Query Engine API: Filtering The [Query Engine API](/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.md) offers the ability to filter results found with its [findMany()](/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md#findmany) method. diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md index d52c48970b..ab54863df4 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md @@ -1,8 +1,8 @@ --- -title: Ordering for Query Engine API - Strapi Developer Documentation -description: (add description here) +title: Ordering & Pagination for Query Engine API - Strapi Developer Docs +description: Use Strapi's Query Engine API to order and paginate the results of your queries. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.html --- - # Query Engine API: Ordering & Paginating diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md index c75495590f..013f057edc 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md @@ -1,8 +1,8 @@ --- -title: Populating for Query Engine API - Strapi Developer Documentation -description: (add description here) +title: Populating for Query Engine API - Strapi Developer Docs +description: Use Strapi's Query Engine API to populate relations when querying your content. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.html --- - # Query Engine API: Populating diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md index e87fb9fd36..f46944c662 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md @@ -1,8 +1,8 @@ --- -title: Single Operations for Query Engine API - Strapi Developer Documentation -description: (add description here) +title: Single Operations for Query Engine API - Strapi Developer Docs +description: Use Strapi's Query Engine API to perform operations on single entries. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.html --- - # Query Engine API: Single Operations diff --git a/docs/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md b/docs/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md index 0b7fd5a0bd..6f639c0fa2 100644 --- a/docs/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md +++ b/docs/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md @@ -1,7 +1,8 @@ --- -title: REST API - Strapi Developer Documentation +title: REST API - Strapi Developer Docs description: Interact with your Content-Types using the REST API endpoints Strapi generates for you. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest-api.html --- # REST API diff --git a/docs/developer-docs/latest/developer-resources/error-handling.md b/docs/developer-docs/latest/developer-resources/error-handling.md index 59339011af..f5bc265bd8 100644 --- a/docs/developer-docs/latest/developer-resources/error-handling.md +++ b/docs/developer-docs/latest/developer-resources/error-handling.md @@ -1,10 +1,9 @@ --- -title: Error handling - Strapi Developer Documentation -description: … +title: Error handling - Strapi Developer Docs +description: With Strapi's error handling feature it's easy to send and receive errors in your application. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/error-handling.html --- - - # Error handling Strapi is natively handling errors with a standard format. diff --git a/docs/developer-docs/latest/developer-resources/global-strapi/api-reference.md b/docs/developer-docs/latest/developer-resources/global-strapi/api-reference.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md b/docs/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md index 6f09889f93..5c800f4d1f 100644 --- a/docs/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md +++ b/docs/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md @@ -1,9 +1,9 @@ --- -title: Admin Panel API - Strapi Developer Documentation -description: Strapi allows you to create your own custom local plugins that will work exactly the same as external ones. +title: Admin Panel API - Strapi Developer Docs +description: Strapi's Admin Panel API for plugins allows a Strapi plugin to customize the front end part (i.e. the admin panel) of your application. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.html --- - # Admin Panel API for plugins diff --git a/docs/developer-docs/latest/developer-resources/plugin-api-reference/server.md b/docs/developer-docs/latest/developer-resources/plugin-api-reference/server.md index 1912a96b55..ef167237c9 100644 --- a/docs/developer-docs/latest/developer-resources/plugin-api-reference/server.md +++ b/docs/developer-docs/latest/developer-resources/plugin-api-reference/server.md @@ -1,9 +1,9 @@ --- -title: Server API - Strapi Developer Documentation -description: … +title: Server API - Strapi Developer Docs +description: Strapi's Server API for plugins allows a Strapi plugin to customize the back end part (i.e. the server) of your application. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/developer-resources/plugin-api-reference/server.html --- - # Server API for plugins diff --git a/docs/developer-docs/latest/development/admin-customization.md b/docs/developer-docs/latest/development/admin-customization.md index ab5f9e524e..4f4e991175 100644 --- a/docs/developer-docs/latest/development/admin-customization.md +++ b/docs/developer-docs/latest/development/admin-customization.md @@ -1,7 +1,8 @@ --- -title: Admin panel customization - Strapi Developer Documentation +title: Admin panel customization - Strapi Developer Docs description: The administration panel of Strapi can be customized according to your needs, so you can make it reflect your identity. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/admin-customization.html --- # Admin panel customization diff --git a/docs/developer-docs/latest/development/backend-customization.md b/docs/developer-docs/latest/development/backend-customization.md index ca24e7ba78..c9a7a0d95c 100644 --- a/docs/developer-docs/latest/development/backend-customization.md +++ b/docs/developer-docs/latest/development/backend-customization.md @@ -1,10 +1,9 @@ --- -title: Back-end customization - Strapi Developer Documentation -description: +title: Back-end customization - Strapi Developer Docs +description: All elements of Strapi's back end, like routes, policies, middlewares, controllers, services, models, requests, responses, and webhooks, can be customized. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/backend-customization.html --- - - # Back-end customization Strapi runs an HTTP server based on [Koa](https://koajs.com/), a back end JavaScript framework. diff --git a/docs/developer-docs/latest/development/backend-customization/controllers.md b/docs/developer-docs/latest/development/backend-customization/controllers.md index 1ce146b18a..4ce2c5001d 100644 --- a/docs/developer-docs/latest/development/backend-customization/controllers.md +++ b/docs/developer-docs/latest/development/backend-customization/controllers.md @@ -1,11 +1,10 @@ --- title: Backend customization - Controllers - Strapi Developer Docs -description: +description: Strapi controllers are files that contain a set of methods reached by the client according to the requested route and can be customized according to your needs. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/backend-customization/controllers.html --- - - # Controllers Controllers are JavaScript files that contain a set of methods, called actions, reached by the client according to the requested [route](/developer-docs/latest/development/backend-customization/routes.md). Whenever a client requests the route, the action performs the business logic code and sends back the [response](/developer-docs/latest/development/backend-customization/requests-responses.md#responses). Controllers represent the C in the model-view-controller (MVC) pattern. @@ -14,7 +13,7 @@ In most cases, the controllers will contain the bulk of a project's business log ## Implementation -Controllers can be [generated or added manually](#adding-a-new-controller), and the [core controllers examples](#extending-core-controllers) can help you get started creating custom ones. +Controllers can be [generated or added manually](#adding-a-new-controller). Strapi provides a `createCoreController` factory function that automatically generates core controllers and allows building custom ones or [extend or replace the generated controllers](#extending-core-controllers). ### Adding a new controller @@ -23,31 +22,59 @@ A new controller can be implemented: - with the [interactive CLI command `strapi generate`](/developer-docs/latest/developer-resources/cli/CLI.md#strapi-generate) - or manually by creating a JavaScript file: - in `./src/api/[api-name]/controllers/` for API controllers (this location matters as controllers are auto-loaded by Strapi from there) - - or in a folder like `./src/plugins/[plugin-name]/controllers/` for , though they can be created elsewhere as long as the plugin interface is properly exported in the `strapi-server.js` file (see [Server API for Plugins documentation](/developer-docs/latest/developer-resources/plugin-api-reference/server.md)) + - or in a folder like `./src/plugins/[plugin-name]/controllers/` for plugin controllers, though they can be created elsewhere as long as the plugin interface is properly exported in the `strapi-server.js` file (see [Server API for Plugins documentation](/developer-docs/latest/developer-resources/plugin-api-reference/server.md)) ```js -// path: ./src/api/[api-name]/controllers/my-controller.js +// path: ./src/api/restaurant/controllers/restaurant.js -module.exports = { - async exampleAction(ctx, next) { +const { createCoreController } = require('@strapi/strapi').factories; + +module.exports = createCoreController('api::restaurant.restaurant', ({ strapi }) => { + // Method 1: Creating an entirely custom action + async exampleAction(ctx) { try { ctx.body = 'ok'; } catch (err) { ctx.body = err; } + }, + + // Method 2: Wrapping a core action (leaves core logic in place) + async find(ctx) { + // some custom logic here + ctx.query = { ...ctx.query, local: 'en' } + + // Calling the default core action + const { data, meta } = await super.find(ctx); + + // some more custom logic + meta.date = Date.now() + + return { data, meta }; + }, + + // Method 3: Replacing a core action + async findOne(ctx) { + const { id } = ctx.params; + const { query } = ctx; + + const entity = await strapi.service('api::restaurant.restaurant').findOne(id, query); + const sanitizedEntity = await this.sanitizeOutput(entity, ctx); + + return this.transformResponse(sanitizedEntity); } }; ``` Each controller action can be an `async` or `sync` function. -Every action receives a context object (`ctx`) as the first parameter. `ctx` contains the [request context](/developer-docs/latest/development/backend-customization/requests-responses.md#requests) and the [response context](/developer-docs/latest/development/backend-customization/requests-responses.md#responses). +Every action receives a context object (`ctx`) as a parameter. `ctx` contains the [request context](/developer-docs/latest/development/backend-customization/requests-responses.md#requests) and the [response context](/developer-docs/latest/development/backend-customization/requests-responses.md#responses). ::: details Example: GET /hello route calling a basic controller -A specific `GET /hello` [route](/developer-docs/latest/development/backend-customization/routes.md) is defined, which takes `hello.index` as a handler. Every time a `GET /hello` request is sent to the server, Strapi calls the `index` action in the `hello.js` controller, which returns `Hello World!`: +A specific `GET /hello` [route](/developer-docs/latest/development/backend-customization/routes.md) is defined, the name of the router file (i.e. `index`) is used to call the controller handler (i.e. `index`). Every time a `GET /hello` request is sent to the server, Strapi calls the `index` action in the `hello.js` controller, which returns `Hello World!`: ```js -// path: ./src/api/hello/routes/router.js +// path: ./src/api/hello/routes/hello.js module.exports = { routes: [ @@ -58,7 +85,9 @@ module.exports = { } ] } +``` +```js // path: ./src/api/hello/controllers/hello.js module.exports = { @@ -76,13 +105,12 @@ When a new [content-type](/developer-docs/latest/development/backend-customizati ### Extending core controllers -Default controllers are created for each content-type. These default controllers are used to return responses to API requests (e.g. when the `GET /api/articles/3` is accessed, the `findOne` method of the default controller for the "Article" content-type is called). Default controllers can be customized to implement your own logic. The following code examples should help you get started. +Default controllers and actions are created for each content-type. These default controllers are used to return responses to API requests (e.g. when `GET /api/articles/3` is accessed, the `findOne` action of the default controller for the "Article" content-type is called). Default controllers can be customized to implement your own logic. The following code examples should help you get started. -:::caution -v4 controllers are currently being refactored. The code examples below will be updated soon to reflect these changes. +:::tip +An action from a core controller can be replaced entirely by [creating a custom action](#adding-a-new-controller) and naming the action the same as the original action (e.g. `find`, `findOne`, `create`, `update`, or `delete`). ::: - ::::: details Collection type examples :::: tabs card @@ -91,11 +119,11 @@ v4 controllers are currently being refactored. The code examples below will be u ```js async find(ctx) { - const { query } = ctx; - - const { results, pagination } = await service.find(query); + // some logic here + const { data, meta } = await super.find(ctx); + // some more logic - return transformResponse(sanitize(results), { pagination }); + return { data, meta }; } ``` @@ -105,12 +133,11 @@ async find(ctx) { ```js async findOne(ctx) { - const { id } = ctx.params; - const { query } = ctx; + // some logic here + const response = await super.findOne(ctx); + // some more logic - const entity = await service.findOne(id, query); - - return transformResponse(sanitize(entity)); + return response; } ``` @@ -120,13 +147,11 @@ async findOne(ctx) { ```js async create(ctx) { - const { query } = ctx.request; - - const { data, files } = parseBody(ctx); - - const entity = await service.create({ ...query, data, files }); + // some logic here + const response = await super.create(ctx); + // some more logic - return transformResponse(sanitize(entity)); + return response; } ``` @@ -136,12 +161,11 @@ async create(ctx) { ```js async update(ctx) { - const { id } = ctx.params; - const { query } = ctx.request; - const { data, files } = parseBody(ctx); - const entity = await service.update(id, { ...query, data, files }); + // some logic here + const response = await super.update(ctx); + // some more logic - return transformResponse(sanitize(entity)); + return response; } ``` @@ -151,10 +175,11 @@ async update(ctx) { ```js async delete(ctx) { - const { id } = ctx.params; - const { query } = ctx; - const entity = await service.delete(id, query); - return transformResponse(sanitize(entity)); + // some logic here + const response = await super.delete(ctx); + // some more logic + + return response; } ``` @@ -169,11 +194,12 @@ async delete(ctx) { ```js async find(ctx) { - const { query } = ctx; - const entity = await service.find(query); - return transformResponse(sanitize(entity)); -} + // some logic here + const response = await super.find(ctx); + // some more logic + return response; +} ``` ::: @@ -182,11 +208,11 @@ async find(ctx) { ```js async update(ctx) { - const { query } = ctx.request; - const { data, files } = parseBody(ctx); - const entity = await service.createOrUpdate({ ...query, data, files }); + // some logic here + const response = await super.update(ctx); + // some more logic - return transformResponse(sanitize(entity)); + return response; } ``` @@ -196,10 +222,11 @@ async update(ctx) { ```js async delete(ctx) { - const { query } = ctx; - const entity = await service.delete(query); + // some logic here + const response = await super.delete(ctx); + // some more logic - return transformResponse(sanitize(entity)); + return response; } ``` @@ -215,5 +242,9 @@ Controllers are declared and attached to a route. Controllers are automatically // access an API controller strapi.controller('api::api-name.controller-name'); // access a plugin controller -strapi.controller('plugin::plugin-name.service-name'); +strapi.controller('plugin::plugin-name.controller-name'); ``` + +::: tip +To list all the available controllers, run `yarn strapi controllers:list`. +::: diff --git a/docs/developer-docs/latest/development/backend-customization/middlewares.md b/docs/developer-docs/latest/development/backend-customization/middlewares.md index 94d49f6250..f82f25be6a 100644 --- a/docs/developer-docs/latest/development/backend-customization/middlewares.md +++ b/docs/developer-docs/latest/development/backend-customization/middlewares.md @@ -1,10 +1,9 @@ --- -title: Backend customization - Middlewares - Strapi Developer Documentation -description : … +title: Backend customization - Middlewares - Strapi Developer Docs +description : Strapi middlewares are configured and enabled for the entire Strapi server application. Middlewares can be customized according to your needs. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/backend-customization/middlewares.html --- - - # Middlewares customization ::: strapi Different types of middlewares diff --git a/docs/developer-docs/latest/development/backend-customization/models.md b/docs/developer-docs/latest/development/backend-customization/models.md index 5defd37000..2daa47c93a 100644 --- a/docs/developer-docs/latest/development/backend-customization/models.md +++ b/docs/developer-docs/latest/development/backend-customization/models.md @@ -1,11 +1,10 @@ --- -title: Models - Strapi Developer Documentation -description: (…) +title: Models - Strapi Developer Docs +description: Strapi models (i.e. content-types, components, and dynamic zones) define a representation of the data structure. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/backend-customization/models.html --- - - # Models As Strapi is a headless Content Management System (CMS), creating a data structure for the content is one of the most important aspects of using the software. Models define a representation of the data structure. diff --git a/docs/developer-docs/latest/development/backend-customization/policies.md b/docs/developer-docs/latest/development/backend-customization/policies.md index 94730d2fea..93863f3f24 100644 --- a/docs/developer-docs/latest/development/backend-customization/policies.md +++ b/docs/developer-docs/latest/development/backend-customization/policies.md @@ -1,11 +1,10 @@ --- -title: Policies - Backend customization - Strapi Developer Documentation -description: … +title: Policies - Backend customization - Strapi Developer Docs +description: Strapi policies are functions that execute specific logic on each request before it reaches the controller. Policies can be customized according to your needs. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/backend-customization/policies.html --- - - # Policies Policies are functions that execute specific logic on each request before it reaches the [controller](/developer-docs/latest/development/backend-customization/controllers.md). They are mostly used for securing business logic. @@ -66,7 +65,7 @@ To apply policies to a route, add them to its configuration object (see [routes Policies are called different ways depending on their scope: - use `global::policy-name` for [global policies](#global-policies) -- use `api::api-name.policy-name` for [API policies](#API-policies) +- use `api::api-name.policy-name` for [API policies](#api-policies) - use `plugin::plugin-name.policy-name` for [plugin policies](#plugin-policies) ::: tip diff --git a/docs/developer-docs/latest/development/backend-customization/requests-responses.md b/docs/developer-docs/latest/development/backend-customization/requests-responses.md index 26b62ad01a..b1847af79f 100644 --- a/docs/developer-docs/latest/development/backend-customization/requests-responses.md +++ b/docs/developer-docs/latest/development/backend-customization/requests-responses.md @@ -1,3 +1,9 @@ +--- +title: Requests and Responses - Strapi Developer Docs +description: Learn more about requests and responses for Strapi, the most popular headless CMS. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/backend-customization/requests-responses.html +--- + # Requests & Responses ## Requests diff --git a/docs/developer-docs/latest/development/backend-customization/routes.md b/docs/developer-docs/latest/development/backend-customization/routes.md index 5a2901237c..0b8c8b8fb1 100644 --- a/docs/developer-docs/latest/development/backend-customization/routes.md +++ b/docs/developer-docs/latest/development/backend-customization/routes.md @@ -1,11 +1,10 @@ --- -title: Routes - Strapi Developer Documentation -description: … +title: Routes - Strapi Developer Docs +description: Strapi routes handle requests to your content and are auto-generated for your content-types. Routes can be customized according to your needs. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/backend-customization/routes.html --- - - # Routes Requests sent to Strapi on any URL are handled by routes. By default, Strapi generates routes for all the content-types (see [REST API documentation](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md)). Routes can be [added](#implementation) and configured: @@ -13,46 +12,104 @@ Requests sent to Strapi on any URL are handled by routes. By default, Strapi gen - with [policies](#policies), which are a way to block access to a route, - and with [middlewares](#middlewares), which are a way to control and change the request flow and the request itself. -Once a route exists, reaching it executes some code handled by a controller (see [controllers](/developer-docs/latest/development/backend-customization/controllers.md) documentation). +Once a route exists, reaching it executes some code handled by a controller (see [controllers documentation](/developer-docs/latest/development/backend-customization/controllers.md)). ## Implementation Implementing a new route consists in defining it in a router file within the `.src/api/[apiName]/routes` folder (see [project structure](/developer-docs/latest/setup-deployment-guides/file-structure.md)). -A router file consists of an array of objects, each object being a route with the following parameters: +There are 2 different router file structures, depending on the use case: -| Parameter | Description | Type | -| -------------------------- | -------------------------------------------------------------------------------- | -------- | -| `method` | Method associated to the route (i.e. `GET`, `POST`, `PUT`, `DELETE` or `PATCH`) | `String` | -| `path` | Path to reach, starting with a forward-leading slash (e.g. `/articles`)| `String` | -| `handler` | Function to execute when the route is reached.
Should follow this syntax: `.` | `String` | -| `config`

_Optional_ | Configuration to handle [policies](policies), [middlewares](middlewares) and [public availability](#public-routes) for the route

| `Object` | +- configuring [core routers](#configuring-core-routers) +- or creating [custom routers](#creating-custom-routers). + +### Configuring core routers + +Core routers (i.e. `find`, `findOne`, `create`, `update`, and `delete`) correspond to [default routes](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md#api-endpoints) automatically created by Strapi when a new [content-type](/developer-docs/latest/development/backend-customization/models.md#model-creation) is created. + +Strapi provides a `createCoreRouter` factory function that automatically generates the core routers and allows: + +- passing in configuration options to each router +- and disabling some core routers to [create custom ones](#creating-custom-routers). + +The core router file structure has the following parameters: + +| Parameter | Description | Type | +| ----------| -------------------------------------------------------------------------------------------- | -------- | +| `prefix` | Allows passing in a custom prefix to add to all routers for this model (e.g. `/test`) | `String` | +| `only` | Core routes that will only be loaded

Anything not in this array is ignored. | `Array` | +| `except` | Core routes that should not be loaded

This is functionally the opposite of the `only` parameter. | `Array` | +| `config` | Configuration to handle [policies](#policies), [middlewares](#middlewares) and [public availability](#public-routes) for the route | `Object` | + +
+ +```js +// path: ./src/api/[apiName]/routes/[routerName].js (e.g './src/api/restaurant/routes/restaurant.js') + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::restaurant.restaurant', { + prefix: '', + only: ['find', 'findOne'], + except: [], + config: { + find: { + auth: false, + policies: [], + middlewares: [], + }, + findOne: {}, + create: {}, + update: {}, + delete: {}, + }, +}); +``` + +
Generic implementation example: -To handle any `GET` request on the `/articles` path by calling the `actionName` function from the `controllerName` [controller](/developer-docs/latest/development/backend-customization/controllers.md), use the following code: +To only allow a `GET` request on the `/restaurants` path from the core `find` [controller](/developer-docs/latest/development/backend-customization/controllers.md) without authentication, use the following code: +::: details Example of disabling authentication on a core route ```js -// path: ./src/api/[apiName]/routes/[routerName].js (e.g './src/api/blog/routes/articles.js') +// path: ./src/api/restaurant/routes/restaurant.js -module.exports = { - routes: [ - { - method: 'GET', - path: '/articles', - handler: 'controllerName.actionName', - }, - ], -}; +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::restaurant.restaurant', { + only: ['find'], + config: { + find: { + auth: false + policies: [], + middlewares: [], + } + } +}); ``` +::: + +### Creating custom routers + +Creating custom routers consists in creating a file that exports an array of objects, each object being a route with the following parameters: + +| Parameter | Description | Type | +| -------------------------- | -------------------------------------------------------------------------------- | -------- | +| `method` | Method associated to the route (i.e. `GET`, `POST`, `PUT`, `DELETE` or `PATCH`) | `String` | +| `path` | Path to reach, starting with a forward-leading slash (e.g. `/articles`)| `String` | +| `handler` | Function to execute when the route is reached.
Should follow this syntax: `.` | `String` | +| `config`

_Optional_ | Configuration to handle [policies](policies), [middlewares](middlewares) and [public availability](#public-routes) for the route

| `Object` | +
-The router used by Strapi allows the creation of dynamic routes, using parameters and regular expressions. These parameters will be exposed in the `ctx.params` object. For more details, please refer to the [PathToRegex](https://github.com/pillarjs/path-to-regexp) documentation. +Dynamic routes can be created using parameters and regular expressions. These parameters will be exposed in the `ctx.params` object. For more details, please refer to the [PathToRegex](https://github.com/pillarjs/path-to-regexp) documentation. -::: details Example of routes using URL parameters and regular expressions +::: details Example of a custom router using URL parameters and regular expressions for routes ```js -// path: ./src/api/[apiName]/routes/[routerName].js (e.g './src/api/blog/routes/articles.js') +// path: ./src/api/restaurant/routes/custom-restaurant.js module.exports = { routes: [ @@ -74,7 +131,7 @@ module.exports = { ## Configuration -The optional configuration for a route is defined in its `config` object, which can be used to handle [policies](#policies) and [middlewares](#middlewares) or to [make the route public](#public-routes). +Both [core routers](#configuring-core-routers) and [custom routers](#creating-custom-routers) have the same configuration options. The routes configuration is defined in a `config` object that can be used to handle [policies](#policies) and [middlewares](#middlewares) or to [make the route public](#public-routes). ### Policies @@ -83,30 +140,71 @@ The optional configuration for a route is defined in its `config` object, which - by pointing to a policy registered in `./src/policies`, with or without passing a custom configuration - or by declaring the policy implementation directly, as a function that takes `policyContext` to extend [Koa's context](https://koajs.com/#context) (`ctx`) and the `strapi` instance as arguments (see [policies documentation](/developer-docs/latest/development/backend-customization/routes.md)) +:::: tabs card + +::: tab Core router policy + ```js -// path: ./src/api/[apiName]/routes/[routerName].js (e.g './src/api/blog/routes/articles.js') +// path: ./src/api/restaurant/routes/restaurant.js + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::restaurant.restaurant', { + config: { + find: { + policies: [ + // point to a registered policy + 'policy-name', + + // point to a registered policy with some custom configuration + { name: 'policy-name', config: {} }, + + // pass a policy implementation directly + (policyContext, config, { strapi }) => { + return true; + }, + ] + } + } +}); +``` + +::: + +::: tab Custom router policy + +```js +// path: ./src/api/restaurant/routes/custom-restaurant.js module.exports = { routes: [ { method: 'GET', - path: '/articles', + path: '/articles/customRoute', handler: 'controllerName.actionName', config: { policies: [ - 'policy-name', // point to a registered policy - { name: 'policy-name', config: {} }, // point to a registered policy with some custom configuration + // point to a registered policy + 'policy-name', + + // point to a registered policy with some custom configuration + { name: 'policy-name', config: {} }, + // pass a policy implementation directly (policyContext, config, { strapi }) => { return true; }, - ], + ] }, }, ], }; ``` +::: + +:::: + ### Middlewares [Middlewares](/developer-docs/latest/development/backend-customization/middlewares.md) can be added to a route configuration: @@ -114,19 +212,56 @@ module.exports = { - by pointing to a middleware registered in `./src/middlewares`, with or without passing a custom configuration - or by declaring the middleware implementation directly, as a function that takes [Koa's context](https://koajs.com/#context) (`ctx`) and the `strapi` instance as arguments: +:::: tabs card + +::: tab Core router middleware + ```js -// path: ./src/api/[apiName]/routes/[routerName].js (e.g './src/api/blog/routes/articles.js') +// path: ./src/api/restaurant/routes/restaurant.js + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::restaurant.restaurant', { + config: { + find: { + middlwares: [ + // point to a registered middleware + 'middleware-name', + + // point to a registered middleware with some custom configuration + { name: 'middleware-name', config: {} }, + + // pass a middleware implementation directly + (ctx, next) => { + return next(); + }, + ] + } + } +}); +``` + +::: + +::: tab Custom router middleware + +```js +// path: ./src/api/restaurant/routes/custom-restaurant.js module.exports = { routes: [ { method: 'GET', - path: '/articles', + path: '/articles/customRoute', handler: 'controllerName.actionName', config: { middlewares: [ - 'middleware-name', // point to a registered middleware - { name: 'middleware-name', config: {} }, // point to a registered middleware with some custom configuration + // point to a registered middleware + 'middleware-name', + + // point to a registered middleware with some custom configuration + { name: 'middleware-name', config: {} }, + // pass a middleware implementation directly (ctx, next) => { return next(); @@ -138,20 +273,46 @@ module.exports = { }; ``` +::: + +:::: + ### Public routes -By default, routes are protected by Strapi's authentication system, which is based on [API tokens](/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md#api-tokens) or the use of a plugin such as the [Users & Permissions plugin](/user-docs/latest/plugins/strapi-plugins.md#users-permissions-plugin). +By default, routes are protected by Strapi's authentication system, which is based on [API tokens](/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md) or on the use of the [Users & Permissions plugin](/user-docs/latest/plugins/strapi-plugins.md#users-permissions-plugin). In some scenarios, it can be useful to have a route publicly available and control the access outside of the normal Strapi authentication system. This can be achieved by setting the `auth` configuration parameter of a route to `false`: +:::: tabs card + +::: tab Core router with a public route + ```js -// path: ./src/api/[apiName]/routes/[routerName].js (e.g './src/api/blog/routes/articles.js') +// path: ./src/api/restaurant/routes/restaurant.js + +const { createCoreRouter } = require('@strapi/strapi').factories; + +module.exports = createCoreRouter('api::restaurant.restaurant', { + config: { + find: { + auth: false + } + } +}); +``` + +::: + +::: tab Custom router with a public route + +```js +// path: ./src/api/restaurant/routes/custom-restaurant.js module.exports = { routes: [ { method: 'GET', - path: '/articles', + path: '/articles/customRoute', handler: 'controllerName.actionName', config: { auth: false, @@ -161,4 +322,6 @@ module.exports = { }; ``` -*** +::: + +:::: diff --git a/docs/developer-docs/latest/development/backend-customization/services.md b/docs/developer-docs/latest/development/backend-customization/services.md index 402e8e5163..ddce995525 100644 --- a/docs/developer-docs/latest/development/backend-customization/services.md +++ b/docs/developer-docs/latest/development/backend-customization/services.md @@ -1,17 +1,20 @@ --- -title: -description: +title: Backend customization - Services - Strapi Developer Docs +description: Strapi services are a set of reusable functions, useful to simplify controllers logic. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/backend-customization/services.html --- - - # Services -Services are a set of reusable functions. They are particularly useful to respect the DRY (don’t repeat yourself) programming concept and to simplify [controllers](/developer-docs/latest/development/backend-customization/controllers.md) logic. +Services are a set of reusable functions. They are particularly useful to respect the "don’t repeat yourself" (DRY) programming concept and to simplify [controllers](/developer-docs/latest/development/backend-customization/controllers.md) logic. ## Implementation +Services can be [generated or added manually](#adding-a-new-service). Strapi provides a `createCoreService` factory function that automatically generates core controllers and allows building custom ones or [extend or replace the generated services](#extending-core-services). + +### Adding a new service + A new service can be implemented: - with the [interactive CLI command `strapi generate`](/developer-docs/latest/developer-resources/cli/CLI.md#strapi-generate) @@ -22,15 +25,39 @@ A new service can be implemented: To manually create a service, export a factory function that returns the service implementation (i.e. an object with methods). This factory function receives the `strapi` instance: ```js -/** - * @param {{ strapi: import('@strapi/strapi').Strapi }} opts - */ -module.exports = ({ strapi }) => { - return { - archiveArticles(ids) { - // do some logic here - }, - }; +// path: ./src/api/restaurant/services/restaurant.js + +const { createCoreService } = require('@strapi/strapi').factories; + +module.exports = createCoreService('api::restaurant.restaurant', ({ strapi }) => { + // Method 1: Creating an entirely custom service + async exampleService(...args) { + let response = { okay: true } + + if (response.okay === false) { + return { response, error: true } + } + + return response + }, + + // Method 2: Wrapping a core service (leaves core logic in place) + async find(...args) { + // Calling the default core controller + const { results, pagination } = await super.find(...args); + + // some custom logic + results.forEach(result => { + result.counter = 1; + }); + + return { results, pagination }; + }, + + // Method 3: Replacing a core service + async findOne(entityId, params = {}) { + return strapi.entityService.findOne('api::restaurant.restaurant', entityId, this.getFetchParams(params)); + } }; ``` @@ -45,6 +72,7 @@ The goal of a service is to store reusable functions. An `email` service could b ```js // path: ./src/api/email/services/email.js +const { createCoreService } = require('@strapi/strapi').factories; const nodemailer = require('nodemailer'); // Requires nodemailer to be installed (npm install nodemailer) // Create reusable transporter object using SMTP transport. @@ -56,8 +84,8 @@ const transporter = nodemailer.createTransport({ }, }); -module.exports = { - send: (from, to, subject, text) => { +module.exports = createCoreService('api::restaurant.restaurant', ({ strapi }) => { + send(from, to, subject, text) => { // Setup e-mail data. const options = { from, @@ -72,20 +100,21 @@ module.exports = { }; ``` -The service is now available through the `strapi.services` global variable. It can be used in another part of the codebase, like in the following controller: +The service is now available through the `strapi.service('api::email.email').send(...args)` global variable. It can be used in another part of the codebase, like in the following controller: ```js // path: ./src/api/user/controllers/user.js -module.exports = { +module.exports = createCoreController('api::restaurant.restaurant', ({ strapi }) => { // GET /hello - signup: async ctx => { + async signup(ctx) => { + const { userData } = ctx.body; + // Store the new user in database. - const user = await User.create(ctx.query); + const user = await strapi.service('api::users-permissions.user').add(userData); // Send an email to validate his subscriptions. - strapi.service('api::email.send')('welcome@mysite.com', user.email, 'Welcome', '...'); - + strapi.service('api::email.email').send('welcome@mysite.com', user.email, 'Welcome', '...'); // Send response to the server. ctx.send({ @@ -101,6 +130,137 @@ module.exports = { When a new [content-type](/developer-docs/latest/development/backend-customization/models.md#content-types) is created, Strapi builds a generic service with placeholder code, ready to be customized. ::: +### Extending core services + +Core services are created for each content-type and could be used by [controllers](/developer-docs/latest/development/backend-customization/controllers.md) to execute reusable logic through a Strapi project. Core services can be customized to implement your own logic. The following code examples should help you get started. + +:::tip +A core service can be replaced entirely by [creating a custom service](#adding-a-new-service) and naming it the same as the core service (e.g. `find`, `findOne`, `create`, `update`, or `delete`). +::: + +::::: details Collection type examples + +:::: tabs card + +::: tab find() + +```js +async find(params) { + // some logic here + const { results, pagination } = await super.find(params); + // some more logic + + return { results, pagination }; +} +``` + +::: + +::: tab findOne() + +```js +async findOne(entityId, params) { + // some logic here + const result = await super.findOne(entityId, params); + // some more logic + + return result; +} +``` + +::: + +::: tab create() + +```js +async create(params) { + // some logic here + const result = await super.create(params); + // some more logic + + return result; +} +``` + +::: + +::: tab update() + +```js +async update(entityId, params) { + // some logic here + const result = await super.update(entityId, params); + // some more logic + + return result; +} +``` + +::: + +::: tab delete() + +```js +async delete(entityId, params) { + // some logic here + const result = await super.delete(entityId, params); + // some more logic + + return result; +} +``` + +::: +:::: +::::: + +::::: details Single type examples +:::: tabs card + +::: tab find() + +```js +async find(params) { + // some logic here + const entity = await super.find(params); + // some more logic + + return entity; +} +``` + +::: + +::: tab update() + +```js +async createOrUpdate({ data, ...params }) { + // some logic here + const entity = await super.createOrUpdate({ data, ...params }); + // some more logic + + return entity; +} +``` + +::: + +::: tab delete() + +```js +async delete(params) { + // some logic here + const entity = await super.delete(params); + // some more logic + + return entity; +} +``` + +::: +:::: +::::: + ## Usage Once a service is created, it's accessible from [controllers](/developer-docs/latest/development/backend-customization/controllers.md) or from other services: diff --git a/docs/developer-docs/latest/development/backend-customization/webhooks.md b/docs/developer-docs/latest/development/backend-customization/webhooks.md index dc8e68255d..a02cd827f9 100644 --- a/docs/developer-docs/latest/development/backend-customization/webhooks.md +++ b/docs/developer-docs/latest/development/backend-customization/webhooks.md @@ -1,10 +1,9 @@ --- -title: -description: +title: Webhooks - Strapi Developer Docs +description: Strapi webhooks are user-defined HTTP callbacks used by an application to notify other applications that an event occurred. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/backend-customization/webhooks.html --- - - # Webhooks Webhook is a construct used by an application to notify other applications that an event occurred. More precisely, webhook is a user-defined HTTP callback. Using a webhook is a good way to tell third party providers to start some processing (CI, build, deployment ...). diff --git a/docs/developer-docs/latest/development/plugins-development.md b/docs/developer-docs/latest/development/plugins-development.md index 78c65529fd..62572bdbb2 100644 --- a/docs/developer-docs/latest/development/plugins-development.md +++ b/docs/developer-docs/latest/development/plugins-development.md @@ -1,6 +1,7 @@ --- -title: Plugins development - Strapi Developer Documentation +title: Plugins development - Strapi Developer Docs description: Strapi allows you to create your own custom local plugins that will work exactly the same as external ones. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/plugins-development.html --- # Plugins development diff --git a/docs/developer-docs/latest/development/plugins-extension.md b/docs/developer-docs/latest/development/plugins-extension.md index 6c3c494073..63517c029b 100644 --- a/docs/developer-docs/latest/development/plugins-extension.md +++ b/docs/developer-docs/latest/development/plugins-extension.md @@ -1,11 +1,10 @@ --- title: Plugins extension - Strapi Developer Docs -description: … +description: Strapi plugins can be extended by extending the content-types or the plugin's interface. sidebarDepth: 2 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/development/plugins-extension.html --- - - # Plugins extension Strapi comes with [plugins](/developer-docs/latest/plugins/plugins-intro.md) that can be installed from the Marketplace or as npm packages. You can also create your own plugins (see [plugins development](/developer-docs/latest/development/plugins-development.md)) or extend the existing ones. diff --git a/docs/developer-docs/latest/getting-started/introduction.md b/docs/developer-docs/latest/getting-started/introduction.md index 95f72fab65..86d0fa2e3b 100644 --- a/docs/developer-docs/latest/getting-started/introduction.md +++ b/docs/developer-docs/latest/getting-started/introduction.md @@ -1,13 +1,14 @@ --- -title: Strapi Developer Documentation +title: Strapi Developer Docs description: This documentation contains all technical documentation related to the setup, deployment, update and customization of your Strapi application. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/getting-started/introduction.html --- # Welcome to the Strapi v4 developer documentation! This documentation contains all technical documentation related to the setup, deployment, update and customization of your Strapi application. -::: strapi Can't wait to start using Strapi? +::: strapi Can't wait to start using Strapi? You can directly head to the [Quick Start](quick-start.md)!
If demos are more your thing, we have a [video demo](https://youtu.be/zd0_S_FPzKg), or you can request a [live demo](https://strapi.io/demo)! ::: @@ -21,11 +22,10 @@ As it goes hand in hand with the open-source ecosystem, Strapi is open to contri - [`strapi/strapi`](https://github.com/strapi/strapi): main repository of Strapi, which contains the core of the project. You can find the admin panel, core plugins, plugin providers, and the whole code that runs your Strapi application. Please read the [`CONTRIBUTING.md`](https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md) file to have more information about contributions to the main repository. - [`strapi/documentation`](https://github.com/strapi/documentation): contains the whole documentation of Strapi. Please read the [contribution guide](https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md) to have more information about contributions to the Strapi documentation. -- [`strapi/buffet`](https://github.com/strapi/buffet): [Buffet](https://buffetjs.io) is the component library that is used in the admin panel. It brings consistency between the different admin plugins. +- [`strapi/design-system`](https://github.com/strapi/design-system): is the design system that is used in the admin panel. It brings consistency between the different admin plugins. - [`strapi/strapi-docker`](https://github.com/strapi/strapi-docker): contains the code used to generate the official Docker images for Strapi (available through our [Docker Hub](https://hub.docker.com/r/strapi/strapi)). - [`strapi/awesome-strapi`](https://github.com/strapi/awesome-strapi): contains everything the community built and all managed plugins. It is used as a central place to find and submit new packages such as plugins, middlewares, hooks, and general enhancements to the core of Strapi. - ## Strapi Community Strapi is a community-oriented project with an emphasis on transparency. The Strapi team has at heart to share their vision and build the future of Strapi with the Strapi community. This is why the [roadmap](https://portal.productboard.com/strapi) is open: as all insights are very important and will help steer the project in the right direction, any community member is most welcome to share ideas and opinions there. @@ -33,10 +33,9 @@ Strapi is a community-oriented project with an emphasis on transparency. The Str Community members also take great part in providing the whole community a plethora of resources about Strapi. You can find [tutorials](https://strapi.io/tutorials/) on the Strapi website, where you can also create your own. Also, as an open-source project, the technical documentation of Strapi is open to contributions (see [Open-source & Contribution](#open-source-contribution)). ::: strapi Want to join the community? -You can join [GitHub](https://github.com/strapi/strapi) and the [forum](https://forum.strapi.io/) and share your ideas and opinions with other community members and members of the Strapi team. If you're looking for news and updates about Strapi, [Twitter](https://twitter.com/strapijs) and the [blog](https://strapi.io/blog) are pretty good places to start! +You can join [GitHub](https://github.com/strapi/strapi), the [Forum](https://forum.strapi.io/), and the [Discord](https://discord.strapi.io) to share your ideas and opinions with other community members and members of the Strapi team. If you're looking for news and updates about Strapi, [Twitter](https://twitter.com/strapijs) and the [blog](https://strapi.io/blog) are pretty good places to start! ::: - ## Support Strapi is offered as free and open-source for users who wish to self-host the software. When having an issue or a question, the [forum](https://forum.strapi.io) is great first place to reach out for help. Both the Strapi community and core developers often check this platform and answer posts. diff --git a/docs/developer-docs/latest/getting-started/quick-start.md b/docs/developer-docs/latest/getting-started/quick-start.md index 5af879e372..cb3a82e365 100644 --- a/docs/developer-docs/latest/getting-started/quick-start.md +++ b/docs/developer-docs/latest/getting-started/quick-start.md @@ -1,8 +1,9 @@ --- -title: Quick Start Guide - Strapi Developer Documentation +title: Quick Start Guide - Strapi Developer Docs description: Get ready to get Strapi, your favorite open-source headless cms up and running in less than 3 minutes. sidebarDepth: 0 next: ./troubleshooting +canonicalUrl: https://docs.strapi.io/developer-docs/latest/getting-started/quick-start.html --- # Quick Start Guide @@ -91,15 +92,16 @@ Make sure [Node.js and npm are properly installed](/developer-docs/latest/setup- 👇 Let's get started! Using the big buttons below, please choose between: -* the **Hands-on** path for a DIY approach to run your project -* or the **Starters** path for the quickest way to spin up a fullstack application powered by a Strapi back end. +- the **Hands-on** path for a DIY approach to run your project +- or the **Starters** path for the quickest way to spin up a fullstack application powered by a Strapi back end. :::::: tabs type:card + ::::: tab Hands-on -## 🚀 Part A: Create a new project with Strapi +## 🚀 Part A: Create a new project with Strapi ### Step 1: Run the installation script @@ -109,7 +111,7 @@ Run the following command in a terminal: ```bash -npx create-strapi-app my-project --quickstart +npx create-strapi-app@latest my-project --quickstart ``` @@ -129,7 +131,7 @@ By completing the form, you create your own account. Once done, you become the f You now have access to the [admin panel](http://localhost:1337/admin): -![admin panel screenshot glimpse](../assets/quick-start-guide//qsg-handson-part1-01-admin_panel.png) +![Admin panel screenshot: dashboard](../assets/quick-start-guide//qsg-handson-part1-01-admin_panel.png) ::: callout 🥳 CONGRATULATIONS! You have just created a new Strapi project! You can start playing with Strapi and discover the product by yourself using our [User Guide](/user-docs/latest/getting-started/introduction.md), or proceed to part B below. @@ -155,84 +157,85 @@ The Content-Type Builder plugin helps you create your data structure. When creat Your restaurants directory will eventually include many restaurants, so we need to create a "Restaurant" collection type. Then we can describe the fields to display when adding a new restaurant entry: -1. Go to [Plugins > Content-Type Builder](http://localhost:1337/admin/plugins/content-type-builder) in the main navigation. +1. Go to Plugins ![Content-Type Builder icon](../assets/quick-start-guide/icons/content_types_builder.svg) [Content-Type Builder](http://localhost:1337/admin/plugins/content-type-builder) in the main navigation. 2. Click on **Create new collection type**. -3. Type `restaurant` for the _Display name_, and click **Continue**. +3. Type `Restaurant` for the _Display name_, and click **Continue**. 4. Click the Text field. 5. Type `name` in the _Name_ field. 6. Switch to the _Advanced Settings_ tab, and check the **Required field** and the **Unique field** settings. -7. Click on **Add another Field**. -8. Choose the Rich Text field. +7. Click on **Add another field**. +8. Choose the Rich text field. 9. Type `description` under the _Name_ field, then click **Finish**. 10. Finally, click **Save** and wait for Strapi to restart. ![GIF: Create Restaurant collection type in Content-Type Builder](../assets/quick-start-guide/qsg-handson-restaurant.gif) -Once Strapi has restarted, "Restaurants" is listed under Collection Types in the main navigation. Wow, you have just created your very first content type! It was so cool — let's create another one right now, just for pleasure. +Once Strapi has restarted, "Restaurant" is listed under ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) _Content Manager > Collection types_ in the navigation. Wow, you have just created your very first content type! It was so cool — let's create another one right now, just for pleasure. #### Create a "Category" collection type It would help getting a bit more organized if our restaurants directory had some categories. Let's create a "Category" collection type: -1. Go to [Plugins > Content-Type Builder](http://localhost:1337/admin/plugins/content-type-builder) in the main navigation. +1. Go to Plugins ![Content-Type Builder icon](../assets/quick-start-guide/icons/content_types_builder.svg) [Content-Type Builder](http://localhost:1337/admin/plugins/content-type-builder) in the main navigation. 2. Click on **Create new collection type**. -3. Type `category` for the _Display name_, and click **Continue**. +3. Type `Category` for the _Display name_, and click **Continue**. 4. Click the Text field. 5. Type `name` in the _Name_ field. 6. Switch to the _Advanced Settings_ tab, and check the **Required field** and the **Unique field** settings. -7. Click on **Add another Field**. +7. Click on **Add another field**. 8. Choose the Relation field. 9. On the right side, click the _Category_ relational fields box and select "Restaurant". 10. In the center, select the icon that represents "many-to-many" ![icon many-to-many](../assets/quick-start-guide/icon_manytomany.png). The text should read `Categories has and belongs to many Restaurants`. -![](../assets/quick-start-guide/qsg-handson-part2-02-collection_ct.png) +![Admin Panel screenshot: relations](../assets/quick-start-guide/qsg-handson-part2-02-collection_ct.png) 9. Finally, click **Finish**, then the **Save** button, and wait for Strapi to restart. ### Step 2: Use the collection types to create new entries Now that we have created a basic data structure with 2 collection types, "Restaurant" and "Category", let's use them to actually add content by creating new entries. + #### Create an entry for the "Restaurant" collection type -1. Go to [Collection types > Restaurants](http://localhost:1337/admin/plugins/content-manager/collectionType/application::restaurant.restaurant) in the main navigation. -2. Click on **Add New Restaurants**. +1. Go to ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Collection types - Restaurant](http://localhost:1337/admin/content-manager/collectionType/api::restaurant.restaurant) in the navigation. +2. Click on **Add new entry**. 3. Type the name of your favorite local restaurant in the _Name_ field. Let's say it's `Biscotte Restaurant`. 4. In the _Description_ field, write a few words about it. If you're lacking some inspiration, you can use `Welcome to Biscotte restaurant! Restaurant Biscotte offers a cuisine based on fresh, quality products, often local, organic when possible, and always produced by passionate producers.` -5. Click **Save**. +5. Click **Save**. ![Screenshot: Biscotte Restaurant in Content Manager](../assets/quick-start-guide/qsg-handson-part2-03-restaurant.png) -The restaurant is now listed in the [Collection types > Restaurants](http://localhost:1337/admin/plugins/content-manager/collectionType/application::restaurant.restaurant) view. +The restaurant is now listed in the [Collection types - Restaurant](http://localhost:1337/admin/content-manager/collectionType/api::restaurant.restaurant) view. #### Add Categories -Let's go to [Collection types > Categories](http://localhost:1337/admin/plugins/content-manager/collectionType/application::category.category) and create 2 categories: +Let's go to ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Collection types - Category](http://localhost:1337/admin/content-manager/collectionType/api::category.category) and create 2 categories: -1. Click on **Add New Categories**. +1. Click on **Add new entry**. 2. Type `French Food` in the _Name_ field. 4. Click **Save**. -5. Go back to _Collection types > Categories_, then click again on **Add New Categories**. +5. Go back to _Collection types - Category_, then click again on **Add new entry**. 6. Type `Brunch` in the _Name_ field, then click **Save**. ![GIF: Add Categories](../assets/quick-start-guide/qsg-handson-categories.gif) -The "French Food" and "Brunch" categories are now listed in the [Collection types > Categories](http://localhost:1337/admin/plugins/content-manager/collectionType/application::category.category) view. +The "French Food" and "Brunch" categories are now listed in the [Collection types - Category](http://localhost:1337/admin/content-manager/collectionType/api::category.category) view. #### Add a Category to a Restaurant -Go to [Collection types > Restaurants](http://localhost:1337/admin/plugins/content-manager/collectionType/application::restaurant.restaurant) in the main navigation, and click on "Biscotte Restaurant". +Go to ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Collection types - Restaurant](http://localhost:1337/admin/content-manager/collectionType/api::restaurant.restaurant) in the navigation, and click on "Biscotte Restaurant". -In the right sidebar, in the **Categories** drop-down list, select "Brunch". Click **Save**. +In the right sidebar, in the **Categories** drop-down list, select "Brunch". Click **Save**. ### Step 3: Set Roles & Permissions We have just added a restaurant and 2 categories. We now have enough content to consume (pun intended). But first, we need to make sure that the content is publicly accessible through the API: -1. Click on _General > Settings_ at the bottom of the main navigation. +1. Click on _General ![Settings icon](../assets/quick-start-guide/icons/settings.svg) Settings_ at the bottom of the main navigation. 2. Under _Users & Permissions Plugin_, choose [Roles](http://localhost:1337/admin/settings/users-permissions/roles). 3. Click the **Public** role. 4. Scroll down under _Permissions_. -5. In the _Application_ tab, find _Restaurant_. +5. In the _Permissions_ tab, find _Restaurant_ and click on it. 6. Click the checkboxes next to **find** and **findone**. 7. Repeat with _Category_: click the checkboxes next to **find** and **findone**. 8. Finally, click **Save**. @@ -243,54 +246,51 @@ We have just added a restaurant and 2 categories. We now have enough content to By default, any content you create is saved as a draft. Let's publish our categories and restaurant. -First, navigate to [Collection types > Categories](http://localhost:1337/admin/plugins/content-manager/collectionType/application::category.category). From there: +First, navigate to ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Collection types - Category](http://localhost:1337/admin/content-manager/collectionType/api::category.category). From there: 1. Click the "Brunch" entry. 2. On the next screen, click **Publish**. -3. In the _Please confirm_ window, click **Yes, publish**. +3. In the _Confirmation_ window, click **Yes, publish**. -Then, go back to the Categories list and repeat for the "French food" category. +Then, go back to the Categories list and repeat for the "French Food" category. -Finally, to publish your favorite restaurant, go to [Collection types > Restaurants](http://localhost:1337/admin/plugins/content-manager/collectionType/application::restaurant.restaurant), click the restaurant entry, and **Publish** it. +Finally, to publish your favorite restaurant, go to ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Collection types - Restaurant](http://localhost:1337/admin/content-manager/collectionType/api::restaurant.restaurant), click the restaurant entry, and **Publish** it. ![GIF: Publish content](../assets/quick-start-guide/qsg-handson-publish.gif) + ### Step 5: Use the API OK dear gourmet, we have just finished creating our content and making it accessible through the API. You can give yourself a pat on the back — but you have yet to see the final result of your hard work. -There you are: the list of restaurants is accessible at [http://localhost:1337/restaurants](http://localhost:1337/restaurants). +There you are: the list of restaurants is accessible at [http://localhost:1337/api/restaurants](http://localhost:1337/api/restaurants). Try it now! The result should be similar to the example response below 👇. ::: details Click me to view an example of API response ```json -[ - { - "id":1, - "name":"Biscotte Restaurant", - "description":"Welcome to Biscotte restaurant! Restaurant Biscotte offers a cuisine based on fresh, quality products, often local, organic when possible, and always produced by passionate producers.", - "published_at":"2021-05-27T15:46:43.097Z", - "created_at":"2021-05-27T15:40:01.290Z", - "updated_at":"2021-05-27T15:46:43.110Z", - "categories":[ - { - "id":1, - "name":"French Food", - "published_at":"2021-05-27T15:46:14.704Z", - "created_at":"2021-05-27T15:41:59.725Z", - "updated_at":"2021-05-27T15:46:14.725Z" - }, - { - "id":2, - "name":"Brunch", - "published_at":"2021-05-27T15:46:02.015Z", - "created_at":"2021-05-27T15:42:29.201Z", - "updated_at":"2021-05-27T15:46:02.035Z" +{ + "data": [ + { + "id": 1, + "attributes": { + "name": "Biscotte Restaurant", + "description": "Welcome to Biscotte restaurant! Restaurant Biscotte offers a cuisine based on fresh, quality products, often local, organic when possible, and always produced by passionate producers.", + "createdAt": "2021-11-18T13:34:53.885Z", + "updatedAt": "2021-11-18T13:59:05.035Z", + "publishedAt": "2021-11-18T13:59:05.033Z" } - ] + } + ], + "meta": { + "pagination": { + "page": 1, + "pageSize": 25, + "pageCount": 1, + "total": 1 + } } -] +} ``` ::: @@ -300,19 +300,13 @@ Now your content is created, published, and you have permissions to request it t Keep on creating amazing content! ::: -## ⏩ What to do next? - -### Consume your API +## ⏩ What to do next? -You can learn how to consume your API with your favorite frameworks, front-end or back-end programming languages by choosing one in the list below. +Now that you know the basics of creating and publishing content with Strapi, we encourage you to explore and dig deeper into some Strapi features: - - -### Deploy your project - -The next step is to deploy both your Strapi back end and the front end on the platforms of your choice. - -👉 You can deploy the Strapi back end on various services: Amazon AWS, Microsoft Azure, DigitalOcean, Google App Engine, Heroku, and many more (see our [Deployment guides](/developer-docs/latest/setup-deployment-guides/deployment.md)). +- 👉 [create an API token](/user-docs/latest/settings/managing-global-settings.md#managing-api-tokens) to restrict access to your API, +- 👉 learn how to use Strapi's [REST](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md) and [GraphQL](/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md) APIs to query the content, +- 👉 and [customize your Strapi back end](/developer-docs/latest/development/backend-customization.md) and [admin panel](/developer-docs/latest/development/admin-customization.md). ::::: @@ -320,41 +314,44 @@ The next step is to deploy both your Strapi back end and the front end on the pl ## 🚀 Part A: Create a new project with Strapi starters -Strapi [starters](https://strapi.io/starters) are the fastest way to kickstart your project. They cover many use cases (blog, e-commerce solution, corporate website, portfolio) and integrate with various technologies (Gatsby, Gridsome, Next, Nuxt). +Strapi [starters](https://strapi.io/starters) are the fastest way to kickstart your project. They cover many use cases (blog, e-commerce solution, corporate website, portfolio) and integrate with various technologies (Next, Gridsome, Next, Nuxt). -This quick start guide has been specifically tailored to use the [Gatsby blog starter](https://strapi.io/starters/strapi-starter-gatsby-blog). We highly recommend you to follow along with this starter. Once you get a better understanding of Strapi, you will be able to play with other starters on your own. +This quick start guide has been specifically tailored to use the [Next blog starter](https://strapi.io/starters/strapi-starter-next-js-blog). We highly recommend you to follow along with this starter. Once you get a better understanding of Strapi, you will be able to play with other starters on your own. ### Step 1: Run the installation script -To create a [Gatsby](https://www.gatsbyjs.com/) blog using Strapi, run the following command in a terminal: +To create a [Next](https://nextjs.org/) blog using Strapi, run the following command in a terminal: :::: tabs card ::: tab npm + ```bash - npx create-strapi-starter my-project gatsby-blog + npx create-strapi-starter my-project next-blog ``` + ::: ::: tab yarn + ```bash - yarn create strapi-starter my-project gatsby-blog + yarn create strapi-starter my-project next-blog ``` + :::: During the installation, when terminal asks `Choose your installation type`: select the default `Quickstart (recommended)` option by pressing Enter. The installation then resumes — just let the magic happen! ### Step 2: Register & have a look at your blog -Once the installation is complete, your browser automatically opens 2 tabs: +Once the installation is complete, your browser automatically opens a tab at ([http://localhost:1337/admin/auth/register-admin](http://localhost:1337/admin/auth/register-admin)). It's for Strapi's admin panel, the back end of your application. -* The first tab ([http://localhost:1337/admin/auth/register-admin](http://localhost:1337/admin/auth/register-admin)) is the admin panel, it's for the back end of your application. -* The second tab ([http://localhost:8000](http://localhost:8000)) is for the front end of your application, and you can already see the Gatsby blog in action. +By completing the form in the admin panel tab, you create your own account. Once done, you become the first administator user of this Strapi application. Welcome aboard, commander! - - +Now, open [http://localhost:3000](http://localhost:3000) in another tab. This is the front end of your application, and you can already see the Next blog in action. -By completing the form in the first tab, you create your own account. Once done, you become the first administator user of this Strapi application. Welcome aboard, commander! +Register screen +Next blog frontend screenshot -:::callout CONGRATULATIONS! 🥳 +:::callout CONGRATULATIONS! 🥳 Your blog is ready! You can start playing with Strapi and discover the product by yourself using our [User Guide](/user-docs/latest/getting-started/introduction.md), or proceed to part B below. Writing a blog is not your cup of tea? You can leave this guide and play with other [Starters](https://strapi.io/starters) on your own. @@ -374,7 +371,7 @@ If the Strapi server is not already running, in your terminal, `cd` into the `my You have several ideas for great articles in mind. But first, the world needs to know who you are! -Click on [Collection types > Writers](http://localhost:1337/admin/plugins/content-manager/collectionType/application::writer.writer?page=1&pageSize=10&_sort=name:ASC) in the main navigation, and click the **Add New Writers** button. +Click on ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Collection types - Writer](http://localhost:1337/admin/content-manager/collectionType/api::writer.writer) in the navigation, and click the **Add new entry** button. ![Screenshot: Create a new writer in admin panel](../assets/quick-start-guide/qsg-starters-part2-01-writer.png) @@ -384,11 +381,11 @@ Click on [Collection types > Writers](http://localhost:1337/admin/plugins/conten ### Step 2: Write & publish your first article -To write an article, we need to add a new entry to the "Articles" collection type and fill in a few fields. +To write an article, we need to add a new entry to the "Article" collection type and fill in a few fields. ![Animated GIF to create an article](../assets/quick-start-guide/qsg-starters-part2-03-write_publish_article.gif) -Click on [Collection types > Articles](http://localhost:1337/admin/plugins/content-manager/collectionType/application::article.article?page=1&pageSize=10&_sort=title:ASC) in the main navigation, and click the **Add New Articles** button. +Click on ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Collection types - Article](http://localhost:1337/admin/content-manager/collectionType/api::article.article) in the main navigation, and click the **Add new entry** button. #### Give your article a title, a description, and add some content @@ -403,19 +400,21 @@ In the sidebar on the right, choose your name in the _Author_ drop-down list. Yo While there, you might also want to choose a _Category_ for your article from the list. +🤓 Don't forget to click on **Save** to save the article. + #### Turn your draft into a publication By default, your new article would be saved as a draft. Let's not be too shy and publish it right away. To publish an article, click the **Publish** button at the top of the window. -You have just created and published your first article, "Hello World!". You can find it in the [Collection types > Articles](http://localhost:1337/admin/plugins/content-manager/collectionType/application::article.article?page=1&pageSize=10&_sort=id:DESC) view. +You have just created and published your first article, "Hello World!". You can find it in the ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Collection types - Article](http://localhost:1337/admin/content-manager/collectionType/api::article.article?page=1&pageSize=10&sort=id:DESC) view. ### Step 3: Update the `Homepage` single type It's time to make this blog a bit more yours. -Click on [Single Types > Homepage](http://localhost:1337/admin/plugins/content-manager/singleType/application::homepage.homepage) in the main navigation. Let's edit this homepage: +Click on ![Content Manager icon](../assets/quick-start-guide/icons/content.svg) [Content Manager > Single types - Homepage](http://localhost:1337/admin/content-manager/singleType/api::homepage.homepage) in the main navigation. Let's edit this homepage: 1. Replace the image in the _ShareImage_ field. 2. At the bottom of the page, update the _Title_ to `My Wonderful Strapi Blog` in the _Hero_ field group. @@ -423,32 +422,26 @@ Click on [Single Types > Homepage](http://localhost:1337/admin/plugins/content-m ### Step 4: Restart the servers to reflect latest changes -Gatsby is a static-site generator. It means that you need to restart the servers for changes to appear on the front end: +Next is a static-site generator. It means that you need to restart the servers for changes to appear on the front end: 1. In your terminal, press `Ctrl-C` to stop the servers. 2. Make sure you are in the `my-project` folder. If not, type `cd my-project` and press Enter. 3. Restart the servers by typing `npm run develop` (or `yarn develop`) and press Enter. -After a few moments, you should see your blog with its updated title running at [http://localhost:8000](http://localhost:8000). The "Hello World!" article you have just created is also visible at the bottom of the page. +After a few moments, you should see your blog with its updated title running at [http://localhost:3000](http://localhost:3000). The "Hello World!" article you have just created is also visible at the bottom of the page. -![GIF: Updated Gatsby blog front end](../assets/quick-start-guide/qsg-starters-part2-04-restart_servers.gif) +![GIF: Updated Next blog front end](../assets/quick-start-guide/qsg-starters-part2-04-restart_servers.gif) :::callout CONGRATULATIONS! 🥳 Now you know how to use Strapi to create and update your blog. Keep on creating amazing content! ::: -## ⏩ What to do next? - -The beauty of using Strapi [starters](https://strapi.io/starters) is that the Strapi back end comes with a front end ready out-of-the-box. Now you probably want to show your shiny new website to the world! The next step is then to deploy both the Strapi back end and the front end on the platforms of your choice: - -👉 You can deploy the Strapi back end on various services: Amazon AWS, Microsoft Azure, DigitalOcean, Google App Engine, Heroku, and many more (see our [Deployment guides](/developer-docs/latest/setup-deployment-guides/deployment.md)). - -👉 Deploying the front end mostly depends on the technology it's based on. The easiest way to deploy your Gatsby blog front end is probably to [deploy on Gatsby Cloud](https://support.gatsbyjs.com/hc/en-us/articles/360052324714-Connecting-to-Strapi). +## ⏩ What to do next? -:::strapi To go further with starters +Now that you know the basics of kickstarting your project with a Strapi starter, we encourage you to explore and play a bit further: -* Read more about the [starters CLI](https://strapi.io/blog/announcing-the-strapi-starter-cli) on our blog. -* Start another project! We have lots of other [Starters](https://strapi.io/starters) you can use to kickstart your blog, e-commerce, corporate website, or portfolio project. +* 👉 Start another project! We have lots of other [Starters](https://strapi.io/starters) you can use to kickstart your blog, e-commerce, corporate website, or portfolio project. +* 👉 Read more about the [starters CLI](https://strapi.io/blog/announcing-the-strapi-starter-cli) on our blog. ::::: diff --git a/docs/developer-docs/latest/getting-started/troubleshooting.md b/docs/developer-docs/latest/getting-started/troubleshooting.md index e7cca31c89..b99ce79127 100644 --- a/docs/developer-docs/latest/getting-started/troubleshooting.md +++ b/docs/developer-docs/latest/getting-started/troubleshooting.md @@ -1,7 +1,8 @@ --- -title: Troubleshooting - Strapi Developer Documentation +title: Troubleshooting - Strapi Developer Docs description: Find some answers and solutions to most common issues that you may experience when working with Strapi. sidebarDepth: 0 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/getting-started/troubleshooting.html --- # Frequently Asked Questions @@ -10,7 +11,7 @@ Below are answers and solutions to most common issues that you may experience wh ## Why can't I create or update content-types in production/staging? -Strapi stores model configuration files (what defines the model schema) in files such as `api/restaurant/models/restaurant.settings.json`. Due to how Node.js works, in order for changes to take effect, that would require Node to restart the server. This could potentially cause downtime of your production service and likewise these changes should be tracked in some kind of source control. +Strapi stores model configuration files (what defines the model schema) in files such as `./src/api/restaurant/content-types/restaurant/schema.json`. Due to how Node.js works, in order for changes to take effect, that would require Node to restart the server. This could potentially cause downtime of your production service and likewise these changes should be tracked in some kind of source control. Generally your "flow" of development would follow the following path: @@ -44,6 +45,8 @@ With the components there is a hidden field called `order` that allows entries t For the time being there is no recommended way to handle this automatically and instead it may be required for you to create custom controllers to handle this within your own project. +We are evaluating if we will natively add support for this in the future. We will add more details when they become available. + ## Why are my application's database and uploads resetting on PaaS? If you used `--quickstart` to create your Strapi project, by default this uses the SQLite database. PaaS systems (Heroku, DigitalOcean Apps, Google App Engine, ect) file systems are typically [ephemeral](https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem) or read-only meaning that each time a dyno (container) is reset all filesystem changes are lost. And since both SQLite and local uploads are stored on the filesystem, any changes made to these since the last dyno reset will be deleted. Typically dynos are reset at least once a day, and in most cases multiple times per day or when new code is pushed to these services. @@ -64,10 +67,12 @@ For all these reasons, and others, we think it'll be a mistake and might confuse ## How do I customize a plugin? -Strapi uses a system called [extensions](/developer-docs/latest/development/plugins-extension.md) as plugins are stored in the `node_modules` folder. Due to this extensions work by Strapi detecting newer versions of files and using that as a replacement for the ones stored within the `node_modules`. +Strapi uses a system called [extensions](/developer-docs/latest/development/plugins-extension) as plugins are stored in the `node_modules` folder. Due to this extensions work by Strapi detecting newer versions of files and using that as a replacement for the ones stored within the `node_modules`. You gain the ability to modify these files without forking the plugin package, however you lose the ability to easily update. After each version release you will need to compare your changes to those in the new version and modify your version of the files accordingly. + + ## Can I add my own 3rd party auth provider? Yes, you can either follow the following [guide](/developer-docs/latest/plugins/users-permissions.md#adding-a-new-provider-to-your-project) or you can take a look at the [users-permissions](https://github.com/strapi/strapi/tree/master/packages/strapi-plugin-users-permissions) and submit a pull request to include the provider for everyone. Eventually Strapi does plan to move from the current grant/purest provider to a split natured system similar to the upload providers. @@ -76,7 +81,7 @@ There is currently no ETA on this migration however. ## Does Strapi allow me to change the default ID type or name? -No, currently does not have the ability to allow for changing the default id name nor does it allow you to switch the data type (such as UUID on bookshelf), support for this is being looked at for Strapi v4. +No, currently does not have the ability to allow for changing the default id name nor does it allow you to switch the data type (such as UUID in PostgreSQL), support for this is being looked at in future. ## Can you filter and/or deep filter on dynamic zones and polymorphic relations? @@ -90,8 +95,10 @@ On Linux based operating systems you need root permissions to bind to any port b Likewise since Strapi is Node.js based, in order for changes with the SSL certificate to take place (say when it expires) you would need to restart your application for that change to take effect. -Due to these two issues, it is recommended you use a proxy application such as Nginx, Apache, Traefik, or many others to handle your edge routing to Strapi. There are settings in the environment [server.json](/developer-docs/latest/setup-deployment-guides/configurations/required/server.md) to handle upstream proxies. The proxy block requires all settings to be filled out and will modify any backend plugins such as authentication providers and the upload plugin to replace your standard `localhost:1337` with the proxy URL. +Due to these two issues, it is recommended you use a proxy application such as [Nginx](/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy), [Caddy](/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy), [HAProxy](/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy), Apache, Traefik, or many others to handle your edge routing to Strapi. There are settings in the environment [server.json](/developer-docs/latest/setup-deployment-guides/configurations/required/server.md) to handle upstream proxies. The proxy block requires all settings to be filled out and will modify any backend plugins such as authentication providers and the upload plugin to replace your standard `localhost:1337` with the proxy URL. ## Is X feature available yet? You can see the [ProductBoard roadmap](https://portal.productboard.com/strapi) to see which feature requests are currently being worked on and which have not been started yet. + + diff --git a/docs/developer-docs/latest/getting-started/usage-information.md b/docs/developer-docs/latest/getting-started/usage-information.md index 2e328c83a9..fab9e0eb6c 100644 --- a/docs/developer-docs/latest/getting-started/usage-information.md +++ b/docs/developer-docs/latest/getting-started/usage-information.md @@ -1,7 +1,8 @@ --- -title: Usage information - Strapi Developer Documentation +title: Usage information - Strapi Developer Docs description: We are committed to providing a solution, with Strapi, that exceeds the expectations of the users and community. We are also committed to continuing to develop and make Strapi even better than it is today. sidebarDepth: 0 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/getting-started/usage-information.html --- # Collected Usage Information diff --git a/docs/developer-docs/latest/guides/auth-request.md b/docs/developer-docs/latest/guides/auth-request.md index 09b8948161..53583826c3 100644 --- a/docs/developer-docs/latest/guides/auth-request.md +++ b/docs/developer-docs/latest/guides/auth-request.md @@ -1,10 +1,13 @@ --- -title: Authenticated request - Strapi Developer Documentation +title: Authenticated request - Strapi Developer Docs description: Learn in this guide how you can request the API of your Strapi project as an authenticated user. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/auth-request.html --- # Authenticated request +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + In this guide you will see how you can request the API as an authenticated user. ## Introduction diff --git a/docs/developer-docs/latest/guides/client.md b/docs/developer-docs/latest/guides/client.md index 717a4bc07c..9395f9a116 100644 --- a/docs/developer-docs/latest/guides/client.md +++ b/docs/developer-docs/latest/guides/client.md @@ -1,6 +1,7 @@ --- -title: Client - Strapi Developer Documentation +title: Client - Strapi Developer Docs description: Learn in this guide how to setup a connection with a third party client and use it everywhere in your code. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/client.html --- # Setup a third party client diff --git a/docs/developer-docs/latest/guides/count-graphql.md b/docs/developer-docs/latest/guides/count-graphql.md index 7548dc746a..a6767774e7 100644 --- a/docs/developer-docs/latest/guides/count-graphql.md +++ b/docs/developer-docs/latest/guides/count-graphql.md @@ -1,10 +1,13 @@ --- -title: Count with GraphQL - Strapi Developer Documentation +title: Count with GraphQL - Strapi Developer Docs description: Learn in this guide how to count data with a GraphQL query. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/count-graphql.html --- # Count with GraphQL +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + This guide explains how to count data with a GraphQL query. The count aggregation currently has some issues and this feature is also not available for Bookshelf (SQL databases). diff --git a/docs/developer-docs/latest/guides/custom-admin.md b/docs/developer-docs/latest/guides/custom-admin.md index a1bbf04d88..e921634d55 100644 --- a/docs/developer-docs/latest/guides/custom-admin.md +++ b/docs/developer-docs/latest/guides/custom-admin.md @@ -1,12 +1,14 @@ --- -title: Custom Admin - Strapi Developer Documentation +title: Custom Admin - Strapi Developer Docs description: Learn in this guide how you can customize the admin panel of your Strapi project. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/custom-admin.html --- # Custom admin -In this guide we will see how you can customize the admin panel. +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! +In this guide we will see how you can customize the admin panel. ## Introduction For this example, we will see two things: diff --git a/docs/developer-docs/latest/guides/custom-data-response.md b/docs/developer-docs/latest/guides/custom-data-response.md index c8c78c8e4e..9c6200d28b 100644 --- a/docs/developer-docs/latest/guides/custom-data-response.md +++ b/docs/developer-docs/latest/guides/custom-data-response.md @@ -1,10 +1,13 @@ --- -title: Custom Data Response - Strapi Developer Documentation +title: Custom Data Response - Strapi Developer Docs description: Learn in this guide how you can customize your Strapi project API's response. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/custom-date-response.html --- # Custom data response +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + In this guide we will see how you can customize your API's response. ## Introduction diff --git a/docs/developer-docs/latest/guides/draft.md b/docs/developer-docs/latest/guides/draft.md index 5cff4a0e16..9ebe886a5b 100644 --- a/docs/developer-docs/latest/guides/draft.md +++ b/docs/developer-docs/latest/guides/draft.md @@ -1,18 +1,19 @@ --- -title: Draft System - Strapi Developer Documentation +title: Draft System - Strapi Developer Docs description: Learn in this guide how to create a draft system that will allow you to manage draft, published, and archive status inside your Strapi project. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/draft.html --- # Draft system -This guide will explain how to create a draft system that will allow you to manage draft, published, and archive status. - :::caution -The native **Draft & Publish feature** has been released in **version 3.2**. We suggest you to use the native feature instead of this guide. +The native [**Draft & Publish feature**](/user-docs/latest/content-manager/saving-and-publishing-content.md#saving-publishing-content) has been released in Strapi v3.2. We suggest you to use the native feature instead of this guide. This guide is still useful if you want to see the concept of "force filtering" in action. ::: +This guide will explain how to create a draft system that will allow you to manage draft, published, and archive status. + ## Introduction What we want here is to fetch only data that has a `published` status. diff --git a/docs/developer-docs/latest/guides/error-catching.md b/docs/developer-docs/latest/guides/error-catching.md index 02f9eaf689..3b2b7d77d7 100644 --- a/docs/developer-docs/latest/guides/error-catching.md +++ b/docs/developer-docs/latest/guides/error-catching.md @@ -1,6 +1,7 @@ --- -title: Error Catching - Strapi Developer Documentation +title: Error Catching - Strapi Developer Docs description: Learn in this guide how you can catch errors and send them to the Application Monitoring / Error Tracking Software you want. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/error-catching.html --- # Error catching diff --git a/docs/developer-docs/latest/guides/external-data.md b/docs/developer-docs/latest/guides/external-data.md index 661b64737e..7ebcfcdafb 100644 --- a/docs/developer-docs/latest/guides/external-data.md +++ b/docs/developer-docs/latest/guides/external-data.md @@ -1,10 +1,13 @@ --- -title: External Data - Strapi Developer Documentation +title: External Data - Strapi Developer Docs description: Learn in this guide how to fetch data from an external service to use it in your Strapi project. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/external-data.html --- # Fetching external data +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + This guide explains how to fetch data from an external service to use it in your app. In this example we will see how to daily fetch Docker pull count to store the result in your database. diff --git a/docs/developer-docs/latest/guides/is-owner.md b/docs/developer-docs/latest/guides/is-owner.md index 9d8fe9e0ef..b37dee9d31 100644 --- a/docs/developer-docs/latest/guides/is-owner.md +++ b/docs/developer-docs/latest/guides/is-owner.md @@ -1,10 +1,13 @@ --- -title: Is Owner - Strapi Developer Documentation +title: Is Owner - Strapi Developer Docs description: Learn in this guide how to restrict content editing to content authors only. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/is-owner.html --- # Create is owner policy +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + This guide will explain how to restrict content editing to content authors only. ## Introduction diff --git a/docs/developer-docs/latest/guides/jwt-validation.md b/docs/developer-docs/latest/guides/jwt-validation.md index 2e9353b111..689929afed 100644 --- a/docs/developer-docs/latest/guides/jwt-validation.md +++ b/docs/developer-docs/latest/guides/jwt-validation.md @@ -1,10 +1,13 @@ --- -title: JWT validation - Strapi Developer Documentation +title: JWT validation - Strapi Developer Docs description: Learn in this guide how to validate a JWT (JSON Web Token) with a third party service. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/jwt-validation.html --- # JWT validation +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + In this guide we will see how to validate a `JWT` (JSON Web Token) with a third party service. When you sign in with the authentication route `POST /auth/local`, Strapi generates a `JWT` which lets your users request your API as an authenticated one. diff --git a/docs/developer-docs/latest/guides/process-manager.md b/docs/developer-docs/latest/guides/process-manager.md index e95eb07724..b14537457e 100644 --- a/docs/developer-docs/latest/guides/process-manager.md +++ b/docs/developer-docs/latest/guides/process-manager.md @@ -1,11 +1,14 @@ --- -title: Process Manager - Strapi Developer Documentation +title: Process Manager - Strapi Developer Docs description: Learn in this guide how you can start a Strapi application using a process manager. sidebarDepth: 2 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/process-manager.html --- # Process manager +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + In this guide we will see how you can start a Strapi application using a process manager. ::: tip diff --git a/docs/developer-docs/latest/guides/registering-a-field-in-admin.md b/docs/developer-docs/latest/guides/registering-a-field-in-admin.md index 0c06bce134..69b8928569 100644 --- a/docs/developer-docs/latest/guides/registering-a-field-in-admin.md +++ b/docs/developer-docs/latest/guides/registering-a-field-in-admin.md @@ -1,10 +1,13 @@ --- -title: Field Registering - Strapi Developer Documentation +title: Field Registering - Strapi Developer Docs description: Learn in this guide how you can create a new Field for your administration panel. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/registering-a-field-in-admin.html --- # Creating a new Field in the administration panel +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + In this guide we will see how you can create a new Field for your administration panel. ## Introduction @@ -32,7 +35,7 @@ yarn create strapi-app my-app --quickstart --no-run ``` # Create an application using SQLite and prevent the server from starting automatically as we will create a plugin # right after the project generation -npx create-strapi-app my-app --quickstart --no-run +npx create-strapi-app@latest my-app --quickstart --no-run ``` ::: diff --git a/docs/developer-docs/latest/guides/scheduled-publication.md b/docs/developer-docs/latest/guides/scheduled-publication.md index f113ab6bf5..8bc9121b6f 100644 --- a/docs/developer-docs/latest/guides/scheduled-publication.md +++ b/docs/developer-docs/latest/guides/scheduled-publication.md @@ -1,10 +1,13 @@ --- -title: Scheduled Publication - Strapi Developer Documentation +title: Scheduled Publication - Strapi Developer Docs description: Learn in this guide how to create an article schedule system. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/scheduled-publication.html --- # Scheduled publication +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + This guide will explain how to create an article schedule system. ## Introduction diff --git a/docs/developer-docs/latest/guides/secure-your-app.md b/docs/developer-docs/latest/guides/secure-your-app.md index c5b160f0a7..6aa04f9ecb 100644 --- a/docs/developer-docs/latest/guides/secure-your-app.md +++ b/docs/developer-docs/latest/guides/secure-your-app.md @@ -1,10 +1,13 @@ --- -title: Secure your application - Strapi Developer Documentation +title: Secure your application - Strapi Developer Docs description: Learn in this guide how you can secure your Strapi application by using a third party provider. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/secure-your-app.html --- # Secure your application +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + In this guide we will see how you can secure your Strapi application by using a third party provider. ::: tip diff --git a/docs/developer-docs/latest/guides/send-email.md b/docs/developer-docs/latest/guides/send-email.md index 580fda5370..ead096936b 100644 --- a/docs/developer-docs/latest/guides/send-email.md +++ b/docs/developer-docs/latest/guides/send-email.md @@ -1,10 +1,13 @@ --- -title: Send Email - Strapi Developer Documentation +title: Send Email - Strapi Developer Docs description: Learn in this guide how to use the Email plugin to send email where you want in your Strapi app. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/send-email.html --- # Send email programmatically +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + In this guide we will see how to use the Email plugin to send email where you want in your app. For this example we want to receive an email when a new article's comment is posted and if it contains bad words. diff --git a/docs/developer-docs/latest/guides/slug.md b/docs/developer-docs/latest/guides/slug.md index bfe461dbe3..3e9aa55249 100644 --- a/docs/developer-docs/latest/guides/slug.md +++ b/docs/developer-docs/latest/guides/slug.md @@ -1,10 +1,13 @@ --- -title: Slug System - Strapi Developer Documentation +title: Slug System - Strapi Developer Docs description: Learn in this guide how to create a slug system for a Post, Article or any Content Type you want in your Strapi project. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/slug.html --- # Create a slug system +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + This guide will explain how to create a slug system for a Post, Article or any Content Type you want. ## Create attributes diff --git a/docs/developer-docs/latest/guides/snippets/guide-not-updated.md b/docs/developer-docs/latest/guides/snippets/guide-not-updated.md new file mode 100644 index 0000000000..4b8efb75cd --- /dev/null +++ b/docs/developer-docs/latest/guides/snippets/guide-not-updated.md @@ -0,0 +1,3 @@ +::: caution +This guide might not be up-to-date with Strapi v4. We are currently reworking the "Guides" section as most of the features they cover are now part of Strapi's core. +::: diff --git a/docs/developer-docs/latest/guides/unit-testing.md b/docs/developer-docs/latest/guides/unit-testing.md index ca10340bcd..7748b337d3 100644 --- a/docs/developer-docs/latest/guides/unit-testing.md +++ b/docs/developer-docs/latest/guides/unit-testing.md @@ -1,11 +1,14 @@ --- -title: Unit Testing - Strapi Developer Documentation +title: Unit Testing - Strapi Developer Docs description: Learn in this guide how you can run basic unit tests for a Strapi application using a testing framework. sidebarDepth: 2 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/guides/unit-testing.html --- # Unit testing +!!!include(developer-docs/latest/guides/snippets/guide-not-updated.md)!!! + In this guide we will see how you can run basic unit tests for a Strapi application using a testing framework. ::: tip diff --git a/docs/developer-docs/latest/plugins/documentation.md b/docs/developer-docs/latest/plugins/documentation.md index c0c23c3d0f..58a6c75158 100644 --- a/docs/developer-docs/latest/plugins/documentation.md +++ b/docs/developer-docs/latest/plugins/documentation.md @@ -1,6 +1,7 @@ --- -title: API Documentation - Strapi Developer Documentation +title: API Documentation - Strapi Developer Docs description: By using Swagger UI, the API documentation plugin takes out most of your pain to generate your documentation. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/plugins/documentation.html --- # API Documentation @@ -34,10 +35,6 @@ yarn strapi install documentation When your plugin is installed, you just have to start your application and it will generate your API documentation. -The administration panel lets you configure the basic settings of this plugin. - -![Accessing the documentation](../assets/plugins/documentation/open-doc.gif) - ## Administration panel This plugin comes with an interface that is available in your administration panel and a configuration file. diff --git a/docs/developer-docs/latest/plugins/email.md b/docs/developer-docs/latest/plugins/email.md index a0129ebc25..408107093d 100644 --- a/docs/developer-docs/latest/plugins/email.md +++ b/docs/developer-docs/latest/plugins/email.md @@ -1,6 +1,7 @@ --- -title: Email - Strapi Developer Documentation +title: Email - Strapi Developer Docs description: Send email from your server or externals providers. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/plugins/email.html --- # Email diff --git a/docs/developer-docs/latest/plugins/graphql.md b/docs/developer-docs/latest/plugins/graphql.md index 2935c314ba..87899bc071 100644 --- a/docs/developer-docs/latest/plugins/graphql.md +++ b/docs/developer-docs/latest/plugins/graphql.md @@ -1,7 +1,8 @@ --- -title: GraphQL - Strapi Developer Documentation +title: GraphQL - Strapi Developer Docs description: Use a GraphQL endpoint in your Strapi project to fetch and mutate your content. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/plugins/graphql.html --- # GraphQL @@ -383,7 +384,7 @@ When [extending the GraphQL schema](#extending-the-schema), the `resolversConfig ##### Authorization configuration -By default, the authorization of a GraphQL request is handled by the registered authorization strategy that can be either [API token](/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md#api-tokens) or through the [Users & Permissions plugin](#usage-with-the-users-permissions-plugin). The Users & Permissions plugin offers a more granular control. +By default, the authorization of a GraphQL request is handled by the registered authorization strategy that can be either [API token](/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md) or through the [Users & Permissions plugin](#usage-with-the-users-permissions-plugin). The Users & Permissions plugin offers a more granular control. ::: details Authorization with the Users & Permissions plugin With the Users & Permissions plugin, a GraphQL request is allowed if the appropriate permissions are given. diff --git a/docs/developer-docs/latest/plugins/i18n.md b/docs/developer-docs/latest/plugins/i18n.md index 2d09068e24..f424f2f4ca 100644 --- a/docs/developer-docs/latest/plugins/i18n.md +++ b/docs/developer-docs/latest/plugins/i18n.md @@ -1,7 +1,8 @@ --- -title: Internationalization (i18n) - Strapi Developer Documentation +title: Internationalization (i18n) - Strapi Developer Docs description: Instructions on how to use Strapi Content API with the Internationalization (i18n) optional plugin sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/plugins/i18n.html --- # 🌍 Internationalization (i18n) diff --git a/docs/developer-docs/latest/plugins/plugins-intro.md b/docs/developer-docs/latest/plugins/plugins-intro.md index 5eab163e2b..e13c70dd1f 100644 --- a/docs/developer-docs/latest/plugins/plugins-intro.md +++ b/docs/developer-docs/latest/plugins/plugins-intro.md @@ -1,10 +1,9 @@ --- -title: Strapi plugins - Strapi Developer Documentation -description: In Strapi you can install plugins as npm packages. This allows for easy updates and respect best practices. +title: Strapi plugins - Strapi Developer Docs +description: Strapi comes with built-in plugins (i18n, GraphQL, Users & Permissions, Upload, API documentation, and Email) and you can install plugins as npm packages. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/plugins/plugins-intro.html --- - - # Strapi plugins Strapi comes with these officially supported plugins: diff --git a/docs/developer-docs/latest/plugins/upload.md b/docs/developer-docs/latest/plugins/upload.md index 687cb73418..06f39c081a 100644 --- a/docs/developer-docs/latest/plugins/upload.md +++ b/docs/developer-docs/latest/plugins/upload.md @@ -1,6 +1,7 @@ --- -title: Upload - Strapi Developer Documentation +title: Upload - Strapi Developer Docs description: Upload any kind of file on your server or external providers. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/plugins/upload.html --- # Upload diff --git a/docs/developer-docs/latest/plugins/users-permissions.md b/docs/developer-docs/latest/plugins/users-permissions.md index e277d9be3c..9abc86a142 100644 --- a/docs/developer-docs/latest/plugins/users-permissions.md +++ b/docs/developer-docs/latest/plugins/users-permissions.md @@ -1,7 +1,8 @@ --- -title: Roles & Permissions - Strapi Developer Documentation +title: Roles & Permissions - Strapi Developer Docs description: Protect your API with a full authentication process based on JWT and manage the permissions between the groups of users. sidebarDepth: 2 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html --- # Roles & Permissions diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations.md b/docs/developer-docs/latest/setup-deployment-guides/configurations.md index fd15ef1487..0b5d736d85 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations.md @@ -1,7 +1,8 @@ --- -title: Configurations - Strapi Developer Documentation +title: Configurations - Strapi Developer Docs description: Learn how you can manage and customize the configuration of your Strapi application. sidebarDepth: auto +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations.html --- # Configurations @@ -63,6 +64,7 @@ Some parts of Strapi must be configured for the Strapi application to work prope Strapi also offers the following optional configuration options for specific features: +- [API tokens](/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md) - [functions](/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md) - [cron jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) - [API calls](/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md) @@ -71,4 +73,3 @@ Strapi also offers the following optional configuration options for specific fea - [public assets](/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md) - [Single Sign-On](/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md) - [Role-Based Access Control](/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md) - diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/databases/sqlite.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/databases/sqlite.md index 251a39fa08..cf7bd18d63 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/databases/sqlite.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/databases/sqlite.md @@ -1,6 +1,7 @@ --- -title: SQLite - Strapi Developer Documentation +title: SQLite - Strapi Developer Docs description: Learn how you can use SQLite for your Strapi application. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/databases/sqlite.html --- # SQLite Installation @@ -15,7 +16,7 @@ Simply use one of the following commands. ```sh -npx create-strapi-app my-project --quickstart +npx create-strapi-app@latest my-project --quickstart ``` diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md new file mode 100644 index 0000000000..4b9592d675 --- /dev/null +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md @@ -0,0 +1,31 @@ +--- +title: API tokens - Strapi Developer Docs +description: +--- + +# API tokens + +Authentication strategies in Strapi can either be based on the use of the [Users & Permissions plugin](/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.md) or on the built-in API token feature. + +Using API tokens allows executing a request on [REST API](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md) endpoints as an authenticated user. + +## Creation + +New API tokens are generated from the [admin panel](/user-docs/latest/settings/managing-global-settings.md#managing-api-tokens). + +## Usage + +When performing a request to Strapi's [REST API](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md), the API token should be added to the request's `Authorization` header with the following syntax: `bearer your-api-token`. + +## Configuration + +New API tokens are generated using a salt. This salt is automatically generated by Strapi and stored in `./config/admin.js` as `apiToken.salt`. + +The salt can be customized: + +- either by updating the string value for `apiToken.salt` in `./config/admin.js` (see [admin panel configuration documentation](/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md)) +- or by creating an `API_TOKEN_SALT` [environment variable](/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md#environment-variables) in the `.env` file of the project + +::: caution +Changing the salt invalidates all the existing API tokens. +::: diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md index 9dc8a48d0c..b093705ab0 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md @@ -1,21 +1,20 @@ --- -title: API configuration - Strapi Developer Documentation -description: +title: API configuration - Strapi Developer Docs +description: Strapi's default API parameters can be configured. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/api.html --- - - # API configuration General settings for API calls can be set in the `./config/api.js` file: -| Property | Description | Type | Default | -| ----------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------ | ------- | -| `responses` | Global API response configuration | Object | - | -| `responses.privateAttributes` | Set of globally defined attributes to be treated as private. | String array | `[]` | -| `rest` | REST API configuration | Object | - | -| `rest.defaultLimit` | Default `limit` parameter used in API calls (see [REST API documentation](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md#pagination-by-offset)) | Integer | `100` | -| `rest.maxLimit` | Maximum allowed number that can be requested as `limit` (see [REST API documentation](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md#pagination-by-offset)).

Defaults to `null`, which fetches all results. | Integer | `null` | +| Property | Description | Type | Default | +| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------- | +| `responses` | Global API response configuration | Object | - | +| `responses.privateAttributes` | Set of globally defined attributes to be treated as private. | String array | `[]` | +| `rest` | REST API configuration | Object | - | +| `rest.defaultLimit` | Default `limit` parameter used in API calls (see [REST API documentation](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md#pagination-by-offset)) | Integer | `25` | +| `rest.maxLimit` | Maximum allowed number that can be requested as `limit` (see [REST API documentation](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md#pagination-by-offset)).

Defaults to `null`, which fetches all results. | Integer | `100` | **Example:** diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md index a1faa35573..877ccb4a8f 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md @@ -1,10 +1,9 @@ --- -title: Cron jobs - Strapi Developer Documentation -description: … +title: Cron jobs - Strapi Developer Docs +description: Strapi allows you to configure cron jobs for execution at specific dates and times, with optional reccurence rules. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.html --- - - # Cron jobs :::prerequisites diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md index 3969b0ad6f..350a73b256 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md @@ -1,78 +1,29 @@ --- -title: Environment configuration and variables - Strapi Developer Documentation -description: -sidebarDepth: 3 +title: Environment configuration and variables - Strapi Developer Docs +description: In case you need specific static configurations for specific environments, configurations can be created per environment. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html --- - - # Environment configuration and variables -## Environment configurations - -In case you need specific static configurations for specific environments, and using environment variables becomes tedious, Strapi configurations can be created per environment in `./config/env/{env}/{filename}`. - -These configurations will be merged into the base configurations defined in the `./config` folder. -The environment is based on the `NODE_ENV` environment variable (defaults to `development`). - -When starting Strapi with `NODE_ENV=production` it will load the configuration from `./config/*` and `./config/env/production/*`. Everything defined in the production config will override the default config. - -In combination with environment variables this pattern becomes really powerful. - -Examples: - -`./config/server.js` - -```js -module.exports = { - host: '127.0.0.1', -}; -``` - -`./config/env/production/server.js` - -```js -module.exports = ({ env }) => ({ - host: env('HOST', '0.0.0.0'), -}); -``` - -When starting your application: - -```bash -yarn start -# uses host 127.0.0.1 -``` - -```bash -NODE_ENV=production yarn start -# uses host 0.0.0.0 -``` - -```bash -HOST=10.0.0.1 NODE_ENV=production yarn start -# uses host 10.0.0.1 -``` - -## Environment variables - -### List of Strapi's environment variables +Strapi provides environment variables that can be used in configuration files. An `env()` utility can be used to [retrieve the value of environment variables](#configuration-using-environment-variables) and [cast variables to different types](#casting-environment-variables), and specific [configurations for different environments](#environment-configurations) can be created. +## Strapi's environment variables -Some settings can only be modified through environment variables: +Strapi provides the following environment variables: -| Setting | Type | Description | Default value | -|---|---|---|---| -| `STRAPI_DISABLE_UPDATE_NOTIFICATION` | Boolean | Don't show the notification message about updating strapi in the terminal | `false` | -| `STRAPI_HIDE_STARTUP_MESSAGE` | Boolean | Don't show the startup message in the terminal | `false` | -| `STRAPI_TELEMETRY_DISABLED` | Boolean | Don't send telemetry usage data to Strapi | `false` | -| `STRAPI_LICENSE` | String | The license key to activate the Enterprise Edition | `undefined` | -| `NODE_ENV` | String | Type of environment where the app is running | `'development'` | -| `BROWSER` | Boolean | Open the admin panel in the browser after startup | `true` | -| `ENV_PATH` | String | Path to the file that contains your environment variables | `'./.env'` | -| `STRAPI_PLUGIN_I18N_INIT_LOCALE_CODE`

_Optional_| String | Initialization locale for the app, if the [Internationalization (i18n) plugin](/developer-docs/latest/plugins/i18n.md) is installed and enabled on Content-Types (see [Configuration of i18n in production environments](/developer-docs/latest/plugins/i18n.md#configuration-in-production-environments)) | `'en'` | -| `API_TOKEN_SALT`

_Optional_ | String | Salt to use to generate [API tokens](/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md#api-tokens) | - | +| Setting | Description | Type | Default value | +| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | --------------- | +| `STRAPI_DISABLE_UPDATE_NOTIFICATION` | Don't show the notification message about updating strapi in the terminal | `Boolean` | `false` | +| `STRAPI_HIDE_STARTUP_MESSAGE` | Don't show the startup message in the terminal | `Boolean` | `false` | +| `STRAPI_TELEMETRY_DISABLED` | Don't send telemetry usage data to Strapi | `Boolean` | `false` | +| `STRAPI_LICENSE` | The license key to activate the Enterprise Edition | `String` | `undefined` | +| `NODE_ENV` | Type of environment where the app is running | `String` | `'development'` | +| `BROWSER` | Open the admin panel in the browser after startup | `Boolean` | `true` | +| `ENV_PATH` | Path to the file that contains your environment variables | `String` | `'./.env'` | +| `STRAPI_PLUGIN_I18N_INIT_LOCALE_CODE`

_Optional_ | Initialization locale for the app, if the [Internationalization (i18n) plugin](/developer-docs/latest/plugins/i18n.md) is installed and enabled on Content-Types (see [Configuration of i18n in production environments](/developer-docs/latest/plugins/i18n.md#configuration-in-production-environments)) | `String` | `'en'` | +| `API_TOKEN_SALT`

_Optional_ | Salt to use to generate [API tokens](/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md) | `String` | - | -### Configuration using environment variables +## Configuration using environment variables In most use cases there will be different configurations between environments (e.g. database credentials). @@ -110,11 +61,13 @@ module.exports = ({ env }) => ({ ### Casting environment variables +The `env()` utility can be used to cast environment varibles to different types: + ```js // Returns the env if defined without casting it env('VAR', 'default'); -// Cast to int (using parseInt) +// Cast to integer (using parseInt) env.int('VAR', 0); // Cast to float (using parseFloat) @@ -123,12 +76,47 @@ env.float('VAR', 3.14); // Cast to boolean (check if the value is equal to 'true') env.bool('VAR', true); -// Cast to js object (using JSON.parse) +// Cast to JS object (using JSON.parse) env.json('VAR', { key: 'value' }); -// Cast to an array (syntax: ENV_VAR=[value1, value2, value3] | ENV_VAR=["value1", "value2", "value3"]) +// Cast to array (syntax: ENV_VAR=[value1, value2, value3] | ENV_VAR=["value1", "value2", "value3"]) env.array('VAR', [1, 2, 3]); // Case to date (using new Date(value)) env.date('VAR', new Date()); ``` + +## Environment configurations + +Configurations can be created with the following naming and structure conventions: `./config/env/{environment}/{filename}`. This is useful when you need specific static configurations for specific environments and using environment variables is not the best solution. + +These configurations will be merged into the base configurations defined in the `./config` folder. +The environment is based on the `NODE_ENV` environment variable, which defaults to `development`. + +When starting Strapi with `NODE_ENV=production` it will load the configuration from `./config/*` and `./config/env/production/*`. Everything defined in the production configuration will override the default configuration. In combination with environment variables this pattern becomes really powerful. + +For instance, using the following configuration files will give you various options to start the server: + +```js +// path: ./config/server.js + +module.exports = { + host: '127.0.0.1', +}; + + +// path: ./config/env/production/server.js + +module.exports = ({ env }) => ({ + host: env('HOST', '0.0.0.0'), +}); +``` + +With these configuration files the server will start on various ports depending on the environment variables passed: + +```bash +yarn start # uses host 127.0.0.1 +NODE_ENV=production yarn start # uses host 0.0.0.0 +HOST=10.0.0.1 NODE_ENV=production yarn start # uses host 10.0.0.1 +``` + diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md index a71321be2b..0969a68f24 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md @@ -1,19 +1,16 @@ --- -title: Functions - Strapi Developer Documentation -description: +title: Functions - Strapi Developer Docs +description: Strapi includes life cycle functions (e.g. register, bootstrap and destroy) that control the flow of your application. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.html --- - - # Functions The `./src/index.js` file includes global [register](#register), [bootstrap](#bootstrap) and [destroy](#destroy) functions that can be used to add dynamic and logic-based configurations. ## Register -**Path —** `./src/index.js`. - -The `register` lifecycle function is an asynchronous function that runs before the application is initialized. +The `register` found in `./src/index.js` lifecycle function is an asynchronous function that runs before the application is initialized. It can be used to: - [extend plugins](/developer-docs/latest/development/plugins-extension.md#extending-a-plugin-s-interface) @@ -22,18 +19,17 @@ It can be used to: ## Bootstrap -**Path —** `./src/index.js` - -The `bootstrap` lifecycle function is called at every server start. +The `bootstrap` lifecycle function found in `./src/index.js` is called at every server start. It can be used to: -- create an admin user if there isn't one. -- fill the database with some necessary data. +- create an admin user if there isn't one +- fill the database with some necessary data +- declare custom conditions for the [Role-Based Access Control (RBAC)](/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md) feature -The bootstrap function can be synchronous or asynchronous. +The bootstrap function can be synchronous, asynchronous, or return a premise: -**Synchronous** +**Synchronous function** ```js module.exports = () => { @@ -41,25 +37,26 @@ module.exports = () => { }; ``` -**Return a promise** +**Asynchronous function** ```js -module.exports = () => { - return new Promise(/* some code */); +module.exports = async () => { + await someSetup(); }; ``` -**Asynchronous** +**Function returning a promise** ```js -module.exports = async () => { - await someSetup(); +module.exports = () => { + return new Promise(/* some code */); }; ``` + ## Destroy -The `destroy` function is an asynchronous function that runs before the application gets shut down. +The `destroy` function found in `./src/index.js` is an asynchronous function that runs before the application gets shut down. It can be used to gracefully: diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md index 9e4faad5fc..2a4c9ed308 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md @@ -1,10 +1,9 @@ --- title: Plugins configuration - Strapi Developer Docs -description: … +description: Strapi plugins have a single entry point file to define their configurations. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.html --- - - # Plugins configuration The configurations for all plugins are stored in `/config/plugins.js` (see [project structure](/developer-docs/latest/setup-deployment-guides/file-structure.md)). Each plugin can be configured with the following available parameters: diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md index e59f55cc02..0615a5151b 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md @@ -1,19 +1,14 @@ --- -title: Public assets configuration - Strapi Developer Documentation -description: +title: Public assets configuration - Strapi Developer Docs +description: The public folder of Strapi is used for static files that you want to make accesible to the outside world. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.html --- - - # Public assets configuration Public assets are static files (e.g. images, video, CSS files, etc.) that you want to make accessible to the outside world. -Because an API may need to serve static assets, every new Strapi project includes by default a folder named `/public`. Any file located in this directory is accessible if the request's path doesn't match any other defined route and if it matches a public file name. - -**Example:** - -An image named `company-logo.png` in `./public/` is accessible through `/company-logo.png` URL. +Because an API may need to serve static assets, every new Strapi project includes by default a folder named `/public`. Any file located in this directory is accessible if the request's path doesn't match any other defined route and if it matches a public file name (e.g. an image named `company-logo.png` in `./public/` is accessible through `/company-logo.png` URL). ::: tip `index.html` files are served if the request corresponds to a folder name (`/pictures` url will try to serve `public/pictures/index.html` file). diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md index ceba1d641d..6ee3676b5c 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md @@ -1,10 +1,9 @@ --- -title: Role-Based Access Control (RBAC) - Strapi Developer Documentation -description: +title: Role-Based Access Control (RBAC) - Strapi Developer Docs +description: In Strapi, RBAC is an approach to restricting access to some features of the admin panel to some users. The Community Edition of Strapi offers 3 default roles. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.html --- - - # Role-Based Access Control :::caution 🚧 This API is considered unstable for now. @@ -23,7 +22,7 @@ Declare a single condition as an object, and multiple conditions as an array of - `plugin` (string, _optional_): if the condition is created by a plugin, should be the plugin's name, kebab-cased (e.g `content-manager`), - `handler`: a function used to verify the condition (see [using the condition handler](#using-the-condition-handler)) -Declare and register conditions in your [`./config/functions/bootstrap.js`](/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md#bootstrap) file (see [Registering conditions](#registering-conditions)). +Declare and register conditions in the global [`bootstrap` function](/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md#bootstrap) found in `./src/index.js` (see [Registering conditions](#registering-conditions)). :::note The condition `name` property acts as a [unique id](https://github.com/strapi/strapi/blob/master/packages/strapi-admin/services/permission/condition-provider.js#L22) within its namespace, that is either the plugin if the `plugin` property is defined, or the root namespace. @@ -86,7 +85,7 @@ const condition = { ## Registering conditions -To be available in the admin panel, conditions should be declared and registered in the [`./config/functions/bootstrap.js`](/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md#bootstrap) file. Register a single condition with the `conditionProvider.register()` method: +To be available in the admin panel, conditions should be declared and registered in the global [`bootstrap` function](/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md#bootstrap) found in `./src/index.js`. Register a single condition with the `conditionProvider.register()` method: ```js module.exports = async () => { diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md index e0ec8ea69b..a2c1fd3480 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md @@ -1,11 +1,10 @@ --- -title: Single Sign-On (SSO) - Strapi Developer Documentation -description: +title: Single Sign-On (SSO) - Strapi Developer Docs +description: Strapi's SSO allows you to configure additional sign-in and sign-up methods for your administration panel. It requires an Entreprise Edition with a Gold plan. sidebarDepth: 3 +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.html --- - - # Single Sign-On Single Sign-On on Strapi allows you to configure additional sign-in and sign-up methods for your administration panel. @@ -55,6 +54,10 @@ A provider's configuration is a JavaScript object built with the following prope The `uid` property is the unique identifier of each strategy and is generally found in the strategy's package. If you are not sure of what it refers to, please contact the maintainer of the strategy. ::: +::: note +By default, Strapi security policy does not allow loading images from external URLs, so provider logos will not show up on the [login screen](/user-docs/latest/getting-started/introduction.md#accessing-the-admin-panel) of the admin panel unless [a security exception is added](/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md#security). +::: + ### The `createStrategy` Factory A passport strategy is usually built by instantiating it using 2 parameters: the configuration object, and the verify function. diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md index cc2a9d82b4..441ca07fd4 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md @@ -1,19 +1,47 @@ --- -title: Admin panel configuration - Strapi Developer Documentation -description: +title: Admin panel configuration - Strapi Developer Docs +description: Strapi's admin panel offers a single entry point file for its configuration. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.html --- - - # Admin panel configuration -The `./config/admin.js` is used to define admin panel configuration for the Strapi application. This file should at least include configurations for authentication and [API tokens](#api-tokens). +The `./config/admin.js` is used to define admin panel configuration for the Strapi application. + +## Available options + + The `./config/admin.js` file can include the following parameters: + +| Parameter | Description | Type | Default | +| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `apiToken.salt` | Salt used to generate [API tokens](/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md) | String | (A random string
generated
by Strapi) | +| `auth` | Authentication configuration | Object | - | +| `auth.secret` | Secret used to encode JWT tokens | string | `undefined` | +| `auth.events` | Record of all the events subscribers registered for the authentication | object | `{}` | +| `auth.events.onConnectionSuccess` | Function called when an admin user log in successfully to the administration panel | function | `undefined` | +| `auth.events.onConnectionError` | Function called when an admin user fails to log in to the administration panel | function | `undefined` | +| `url` | Url of your admin panel. Default value: `/admin`. Note: If the url is relative, it will be concatenated with `url`. | string | `/admin` | +| `autoOpen` | Enable or disabled administration opening on start. | boolean | `true` | +| `watchIgnoreFiles` | Add custom files that should not be watched during development. See more [here](https://github.com/paulmillr/chokidar#path-filtering) (property `ignored`). | Array(string) | `[]` | +| `host` | Use a different host for the admin panel. Only used along with `strapi develop --watch-admin` | string | `localhost` | +| `port` | Use a different port for the admin panel. Only used along with `strapi develop --watch-admin` | string | `8000` | +| `serveAdminPanel` | If false, the admin panel won't be served. Note: the `index.html` will still be served, see [defaultIndex option](/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md) | boolean | `true` | +| `forgotPassword` | Settings to customize the forgot password email (see more here: [Forgot Password Email](/developer-docs/latest/development/admin-customization.md#forgotten-password-email)) | Object | {} | +| `forgotPassword.emailTemplate` | Email template as defined in [email plugin](/developer-docs/latest/plugins/email.md#programmatic-usage) | Object | [Default template](https://github.com/strapi/strapi/tree/master/packages/strapi-admin/config/email-templates/forgot-password.js) | +| `forgotPassword.from` | Sender mail address | string | Default value defined in your [provider configuration](/developer-docs/latest/plugins/email.md#configure-the-plugin) | +| `forgotPassword.replyTo` | Default address or addresses the receiver is asked to reply to | string | Default value defined in your [provider configuration](/developer-docs/latest/plugins/email.md#configure-the-plugin) | + +## Configurations + +The `./config/admin.js` file should at least include a minimal configuration with required parameters for authentication and [API tokens](/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md). Additional parameters can be included for a full configuration. + +:::note +[Environmental configurations](/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md) (i.e. using the `env()` helper) do not need to contain all the values so long as they exist in the default `./config/server.js`. +::: :::: tabs card ::: tab Minimal configuration -## Minimal configuration - The default configuration created with any new project should at least include the following: ```js @@ -34,8 +62,6 @@ module.exports = ({ env }) => ({ ::: tab Full configuration -## Full configuration - ```js // path: ./config/admin.js @@ -74,42 +100,3 @@ module.exports = ({ env }) => ({ ::: :::: -## Available options - - The `./config/admin.js` file can include the following parameters: - -| Parameter | Description | Type | Default | -| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `apiToken.salt` | Salt used to generate [API tokens](#api-tokens) | String | (A random string
generated
by Strapi) | -| `auth` | Authentication configuration | Object | - | -| `auth.secret` | Secret used to encode JWT tokens | string | `undefined` | -| `auth.events` | Record of all the events subscribers registered for the authentication | object | `{}` | -| `auth.events.onConnectionSuccess` | Function called when an admin user log in successfully to the administration panel | function | `undefined` | -| `auth.events.onConnectionError` | Function called when an admin user fails to log in to the administration panel | function | `undefined` | -| `url` | Url of your admin panel. Default value: `/admin`. Note: If the url is relative, it will be concatenated with `url`. | string | `/admin` | -| `autoOpen` | Enable or disabled administration opening on start. | boolean | `true` | -| `watchIgnoreFiles` | Add custom files that should not be watched during development. See more [here](https://github.com/paulmillr/chokidar#path-filtering) (property `ignored`). | Array(string) | `[]` | -| `host` | Use a different host for the admin panel. Only used along with `strapi develop --watch-admin` | string | `localhost` | -| `port` | Use a different port for the admin panel. Only used along with `strapi develop --watch-admin` | string | `8000` | -| `serveAdminPanel` | If false, the admin panel won't be served. Note: the `index.html` will still be served, see [defaultIndex option](/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md) | boolean | `true` | -| `forgotPassword` | Settings to customize the forgot password email (see more here: [Forgot Password Email](/developer-docs/latest/development/admin-customization.md#forgotten-password-email)) | Object | {} | -| `forgotPassword.emailTemplate` | Email template as defined in [email plugin](/developer-docs/latest/plugins/email.md#programmatic-usage) | Object | [Default template](https://github.com/strapi/strapi/tree/master/packages/strapi-admin/config/email-templates/forgot-password.js) | -| `forgotPassword.from` | Sender mail address | string | Default value defined in your [provider configuration](/developer-docs/latest/plugins/email.md#configure-the-plugin) | -| `forgotPassword.replyTo` | Default address or addresses the receiver is asked to reply to | string | Default value defined in your [provider configuration](/developer-docs/latest/plugins/email.md#configure-the-plugin) | - -## API tokens - -Authentication strategies in Strapi can either be based on the use of the [Users & Permissions plugin](/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.md) or on the built-in [API token](/user-docs/latest/settings/managing-global-settings.md#managing-api-tokens) feature. - -Using API tokens allows executing a request on [REST API](/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md) endpoints as an authenticated user. The API token should be added to the request's `Authorization` header with the following syntax: `bearer your-api-token`. - -New API tokens are generated from the admin panel using a salt. This salt is automatically generated by Strapi and stored in `./config/admin.js` as `apiToken.salt`. - -The salt can be customized: - -- either by updating the string value for `apiToken.salt` in `./config/admin.js` -- or by creating an `API_TOKEN_SALT` [environment variable](/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md#environment-variables) in the `.env` file of the project - -::: caution -Changing the salt invalidates all the existing API tokens. -::: diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md index ade5c64e0c..01c26bf932 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md @@ -1,52 +1,76 @@ --- -title: Database configuration - Strapi Developer Documentation -description: Strapi databases have a single entry point file to define their configurations. +title: Database configuration - Strapi Developer Docs +description: Strapi offers a single entry point file to configure its databases. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/required/databases.html --- - - # Database configuration The `./config/database.js` file is used to define database connections that will be used to store the application content. :::strapi Supported databases -The CLI installation guide details [supported database and versions](http://localhost:8080/documentation/developer-docs/latest/setup-deployment-guides/installation/cli.md#preparing-the-installation). +The CLI installation guide details [supported database and versions](/developer-docs/latest/setup-deployment-guides/installation/cli.md#preparing-the-installation). ::: -## Configuration Structure - -**Path —** `./config/database.js`. - -- `connection` (object): Database configuration options passed to [Knex.js](https://github.com/knex/knex) - - `client` (string): Database client to create the connection. `sqlite` or `postgres` or `mysql`. - - `connection` (object): Database connection information - - `host` (string): Database host name. Default value: `localhost`. - - `port` (integer): Database port. - - `database` (string): Database name. - - `username` (string): Username used to establish the connection. - - `password` (string): Password used to establish the connection. - - `timezone` (string): Set the default behavior for local time. Default value: `utc` [Timezone options](https://www.php.net/manual/en/timezones.php). - - `schema` (string): Set the default database schema. **Used only for Postgres DB.** - - `ssl` (boolean/object): For ssl database connection. Object is used to pass certificate files as strings. - - `useNullAsDefault` (boolean): Will use `NULL` as a default value **Used only for SQLite** - - `debug` (boolean): Show database exchanges and errors. - - - `pool` (object _optional_): [Tarn.js](https://github.com/vincit/tarn.js) database pooling options - - `min` (integer): Minimum number of database connections to keepalive Default value: `0` - - `max` (integer): Maximum number of database connections to keepalive Default value: `10` - - `acquireTimeoutMillis` (integer): Time in ms before timing out a database connection attempt - - `createTimeoutMillis` (integer): Time in ms before timing out a create query attempt - - `destroyTimeoutMillis` (integer): Time in ms before timing out a destroy query attempt - - `idleTimeoutMillis` (integer): Time in ms before free database connections are destroyed - - `reapIntervalMillis` (integer): Time in ms to check for idle database connections to destroy - - `createRetryIntervalMillis` (integer): Time in ms to idle before retrying failed create actions - - `afterCreate` (function): Callback function to execute custom logic when the pool acquires a new connection. See the [Knex.js documentation](https://knexjs.org/#Installation-pooling) for more information -- `settings` (object): Strapi specific database settings - - `forceMigration` (boolean): Enable or disable the forced database migration. Default value: `true`. +## Configuration structure + +The `./config/database.js` accepts 2 main configuration objects: + +- [`connection`](#connection-configuration-object) for database configuration options passed to [Knex.js](https://github.com/knex/knex) +- [`settings`](#settings-configuration-object) for Strapi-specific database settings + +### `connection` configuration object + +| Parameter | Description | Type | +| ------------------------------------------------------------------ | ---------------------------------------------------------------------------- | --------- | +| `client` | Database client to create the connection. `sqlite` or `postgres` or `mysql`. | `String` | +| `connection` | Database [connection information](#connection-parameters) | `Object` | +| `debug` | Show database exchanges and errors. | `Boolean` | +| `useNullAsDefault`

_Optional, only for SQLite_ | Use `NULL` as a default value | `Boolean` | +| `pool`

_Optional_ | [Database pooling options](#database-pooling-options) | `Object` | + +#### Connection parameters + +The `connection.connection` object found in `./config/database.js` is used to pass database connection information and accepts the following parameters: + +| Parameter | Description | Type | +| ---------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------- | +| `host` | Database host name. Default value: `localhost`. | `String` | +| `port` | Database port | `Integer` | +| `database` | Database name. | `String` | +| `username` | Username used to establish the connection | `String` | +| `password` | Password used to establish the connection | `String` | +| `timezone` | Set the default behavior for local time. Default value: `utc` [Timezone options](https://www.php.net/manual/en/timezones.php) | `String` | +| `schema` | Set the default database schema. **Used only for Postgres DB.** | `String` | +| `ssl` | For SSL database connection.
Use an object to pass certificate files as strings. | `Boolean` or `Object` | + +#### Database pooling options + +The `connection.pool` object optionally found in `./config/database.js` is used to pass [Tarn.js](https://github.com/vincit/tarn.js) database pooling options and accepts the following parameters: + +| Parameter | Description | Type | Default | +| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------- | +| `min` | Minimum number of database connections to keepalive | `Integer` | `0` | +| `max` | Maximum number of database connections to keepalive | `Integer` | `10` | +| `acquireTimeoutMillis` | Time in ms before timing out a database connection attempt | `Integer` | - | +| `createTimeoutMillis` | Time in ms before timing out a create query attempt | `Integer` | - | +| `destroyTimeoutMillis` | Time in ms before timing out a destroy query attempt | `Integer` | - | +| `idleTimeoutMillis` | Time in ms before free database connections are destroyed | `Integer` | - | +| `reapIntervalMillis` | Time in ms to check for idle database connections to destroy | `Integer` | - | +| `createRetryIntervalMillis` | Time in ms to idle before retrying failed create actions | `Integer` | - | +| `afterCreate` | Callback function to execute custom logic when the pool acquires a new connection.

See the [Knex.js documentation](https://knexjs.org/#Installation-pooling) for more information | `Function` | - | + +### `settings` configuration object + +The `settings` object found in `./config/database.js` is used to configure Strapi-specific database settings and accepts the following parameter: + +| Parameter | Description | Type | Default | +| ---------------- | ------------------------------------------------ | --------- | ------- | +| `forceMigration` | Enable or disable the forced database migration. | `Boolean` | `true` | -### Configuration Examples +### Configuration examples ::::: tabs card @@ -73,8 +97,8 @@ module.exports = ({ env }) => ({ ``` :::caution -We are aware that there is an issue regarding **SSL support for the server**. -In order to fix it, you have to to set the `ssl:{}` object as a boolean in order to disable it. See below for example: +Strapi is aware that there is an issue regarding **SSL support for the server**. +In order to fix it, you have to set the `ssl:{}` object as a boolean in order to disable it. See below for example: ```js module.exports = ({ env }) => ({ @@ -152,18 +176,14 @@ module.exports = ({ env }) => ({ ::::: -::: tip -Take a look at the [database's guide](#databases-installation-guides) for more details. -::: - ## Configuration in database -Configuration files are not multi server friendly. So we created a data store for config you will want to update in production. +Configuration files are not multi-server friendly. To update configurations in production you can use a data store to get and set settings. ### Get settings -- `environment` (string): Sets the environment you want to store the data in. By default it's current environment (can be an empty string if your config is environment agnostic). -- `type` (string): Sets if your config is for an `api`, `plugin` or `core`. By default it's `core`. +- `environment` (string): Sets the environment you want to store the data in. By default it's current environment (can be an empty string if your configuration is environment agnostic). +- `type` (string): Sets if your configuration is for an `api`, `plugin` or `core`. By default it's `core`. - `name` (string): You have to set the plugin or api name if `type` is `api` or `plugin`. - `key` (string, required): The name of the key you want to store. @@ -204,12 +224,13 @@ await pluginStore.set({ ## Databases installation guides -Strapi gives you the option to choose the most appropriate database for your project. It currently supports **PostgreSQL**, **SQLite**, **MySQL** and -**MariaDB**. The following documentation covers how to install these databases locally (for development purposes) and on various hosted or cloud server solutions (for staging or production purposes). We will be providing additional installation guides for missing databases soon! +Strapi gives you the option to choose the most appropriate database for your project. It currently supports **PostgreSQL**, **SQLite**, **MySQL** and **MariaDB**. + +The following documentation covers how to install SQLite locally (for development purposes): -::: strapi Strapi deployment -Deploying Strapi itself is covered in the [deployment guide](/developer-docs/latest/setup-deployment-guides/deployment.md). +:::caution +Installation guides for other databases (MySQL, MariaDB) are being reworked. [Contributions](https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md) are most welcome. ::: diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md index e62d606814..ea0da7e353 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md @@ -1,10 +1,9 @@ --- -title: Middlewares configuration - Strapi Developer Documentation -description: +title: Middlewares configuration - Strapi Developer Docs +description: Strapi offers a single entry point file for its middlewares configurations. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.html --- - - # Middlewares configuration ::: strapi Different types of middlewares @@ -100,7 +99,7 @@ Strapi's core includes the following internal middlewares, mostly used for perfo - [public](#public), ::: caution -The following built-in middlewares are automatically added by Strapi: `errors`, `security`, `cors`, `query`', `body`, `public`, `favicon`. They should not be removed. Removing them will throw an error. +The following built-in middlewares are automatically added by Strapi: `errors`, `security`, `cors`, `query`', `body`, `public`, `favicon`. They should not be removed as it will throw an error. ::: ### `body` @@ -128,7 +127,7 @@ This security middleware is about cross-origin resource sharing (CORS) and is ba | `origin` | Allowed URLs.

The value(s) can be:
  • strings (e.g. `http://example1.com, http://example2.com`)
  • an array of strings (e.g. `['http://www.example1.com', 'http://example1.com']`)
  • or `*` to allow all URLs
| `String or Array` | `*` | | `maxAge` | Configure the `Access-Control-Max-Age` CORS header parameter, in seconds | `String or Number` | `31536000` | | | `credentials` | Configure the `Access-Control-Allow-Credentials` CORS header | `Boolean` | `true` | -| `methods` | Configures the `Access-Control-Allow-Methods` CORS header | `Array` or `String` | `['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']` | +| `methods` | Configure the `Access-Control-Allow-Methods` CORS header | `Array` or `String` | `['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']` | | `headers` | Configure the `Access-Control-Allow-Headers` CORS header

If not specified, defaults to reflecting the headers specified in the request's `Access-Control-Request-Headers` header | `Array` or `String` | `['Content-Type', 'Authorization', 'Origin', 'Accept']` | | `keepHeaderOnError` | Add set headers to `err.header` if an error is thrown | `Boolean` | `false` | | @@ -224,24 +223,11 @@ The security middleware is based on [koa-helmet](https://helmetjs.github.io/) an | Option | Description | Type | Default value | | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ | ---------------------------------------------------- | -| `crossOriginEmbedderPolicy` | Sets the `Cross-Origin-Embedder-Policy` header to `require-corp` | `Boolean` | `false` | -| `crossOriginOpenerPolicy` | Sets the `Cross-Origin-Opener-Policy` header | `Boolean` | `false` | -| `crossOriginOpenerPolicy` | Sets the `Cross-Origin-Resource-Policy` header | `Boolean` | `false` | -| `originAgentCluster` | Sets the `Origin-Agent-Cluster` header | `Boolean` | `false` | -| `contentSecurityPolicy` | Sets the `Content-Security-Policy` header | `Boolean` | `false` | -| `xssFilter` | Disables browsers' cross-site scripting filter by setting the `X-XSS-Protection` header to `0` | `false` | | -| `hsts` | Sets options for the HTTP Strict Transport Security (HSTS) policy.

Accepts the following parameters:
  • `maxAge`: Number of seconds HSTS is in effect
  • `includeSubDomains`: Applies HSTS to all subdomains of the host
|
  • `maxAge`: `Integer`
  • `includeSubDomains`: `Boolean`
|
  • `maxAge`: `31536000`
  • `includeSubDomains`: `true`
| -| `frameguard` | Sets `X-Frame-Options` header to help mitigate clickjacking attacks

Accepts the `action` parameter that specifies which directive to use. | `String` | `sameorigin` | - - +| `crossOriginEmbedderPolicy` | Set the `Cross-Origin-Embedder-Policy` header to `require-corp` | `Boolean` | `false` | +| `crossOriginOpenerPolicy` | Set the `Cross-Origin-Opener-Policy` header | `Boolean` | `false` | +| `crossOriginOpenerPolicy` | Set the `Cross-Origin-Resource-Policy` header | `Boolean` | `false` | +| `originAgentCluster` | Set the `Origin-Agent-Cluster` header | `Boolean` | `false` | +| `contentSecurityPolicy` | Set the `Content-Security-Policy` header | `Boolean` | `false` | +| `xssFilter` | Disable browsers' cross-site scripting filter by setting the `X-XSS-Protection` header to `0` | `false` | | +| `hsts` | Set options for the HTTP Strict Transport Security (HSTS) policy.

Accepts the following parameters:
  • `maxAge`: Number of seconds HSTS is in effect
  • `includeSubDomains`: Applies HSTS to all subdomains of the host
|
  • `maxAge`: `Integer`
  • `includeSubDomains`: `Boolean`
|
  • `maxAge`: `31536000`
  • `includeSubDomains`: `true`
| +| `frameguard` | Set `X-Frame-Options` header to help mitigate clickjacking attacks

Accepts the `action` parameter that specifies which directive to use. | `String` | `sameorigin` | diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md index f33c9f4ca0..7d5ba9e87e 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md @@ -1,20 +1,43 @@ --- -title: Server configuration - Strapi Developer Documentation -description: +title: Server configuration - Strapi Developer Docs +description: Strapi offers a single entry point file for its server configuration. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/required/server.html --- - - # Server configuration The `./config/server.js` is used to define server configuration for the Strapi application. +## Available options + +The `./config/server.js` file can include the following parameters: + + + +| Parameter | Description | Type | Default | +| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `host`

❗️ _Mandatory_ | Host name | string | `localhost` | +| `port`

❗️ _Mandatory_ | Port on which the server should be running. | integer | `1337` | +| `socket` | Listens on a socket. Host and port are cosmetic when this option is provided and likewise use `url` to generate proper urls when using this option. This option is useful for running a server without exposing a port and using proxy servers on the same machine (e.g [Heroku nginx buildpack](https://github.com/heroku/heroku-buildpack-nginx#requirements-proxy-mode)) | string \| integer | `/tmp/nginx.socket` | +| `emitErrors` | Enable errors to be emitted to `koa` when they happen in order to attach custom logic or use error reporting services. | boolean | `false` | +| `url` | Public url of the server. Required for many different features (ex: reset password, third login providers etc.). Also enables proxy support such as Apache or Nginx, example: `https://mywebsite.com/api`. The url can be relative, if so, it is used with `http://${host}:${port}` as the base url. An absolute url is however recommended. | string | `''` | +| `proxy` | Set the koa variable `app.proxy`. When `true`, proxy header fields will be trusted. | boolean | `false` | +| `cron` | Cron configuration (powered by [`node-schedule`](https://github.com/node-schedule/node-schedule)) | Object | | +| `cron.enabled` | Enable or disable [CRON jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) to schedule jobs at specific dates. | boolean | `false` | +| `cron.tasks` | Declare [CRON jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) to be run at specific dates. | boolean | `false` | + +## Configurations + +The `./config/server.js` file should at least include a minimal configuration with the `host` and `port` parameters. Additional parameters can be included for a full configuration. + +:::note +[Environmental configurations](/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md) (i.e. using the `env()` helper) do not need to contain all the values so long as they exist in the default `./config/server.js`. +::: + ::::: tabs card :::: tab Minimal configuration -## Minimal configuration - The default configuration created with any new project should at least include the following: ```js @@ -26,22 +49,12 @@ module.exports = ({ env }) => ({ }); ``` -:::note -Environmental configurations (`env`) do not need to contain all these values so long as they exist in the default `./config/server.js`. -::: - :::: :::: tab Full configuration -## Full configuration - The following is an example of a full configuration file. Not all of these keys are required (see [available options](#available-options)). -:::note -Environmental configurations (`env`) do not need to contain all these values so long as they exist in the default `./config/server.js`. -::: - ```js // path: ./config/server.js @@ -61,21 +74,3 @@ module.exports = ({ env }) => ({ :::: ::::: - -## Available options - -The `./config/server.js` file can contain the following parameters: - - - -| Parameter | Description | Type | Default | -| --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `host`

❗️ _Mandatory_ | Host name | string | `localhost` | -| `port`

❗️ _Mandatory_ | Port on which the server should be running. | integer | `1337` | -| `socket` | Listens on a socket. Host and port are cosmetic when this option is provided and likewise use `url` to generate proper urls when using this option. This option is useful for running a server without exposing a port and using proxy servers on the same machine (e.g [Heroku nginx buildpack](https://github.com/heroku/heroku-buildpack-nginx#requirements-proxy-mode)) | string \| integer | `/tmp/nginx.socket` | -| `emitErrors` | Enable errors to be emitted to `koa` when they happen in order to attach custom logic or use error reporting services. | boolean | `false` | -| `url` | Public url of the server. Required for many different features (ex: reset password, third login providers etc.). Also enables proxy support such as Apache or Nginx, example: `https://mywebsite.com/api`. The url can be relative, if so, it is used with `http://${host}:${port}` as the base url. An absolute url is however **recommended**. | string | `''` | -| `proxy` | Set the koa variable `app.proxy`. When `true`, proxy header fields will be trusted. | boolean | `false` | -| `cron` | Cron configuration (powered by [`node-schedule`](https://github.com/node-schedule/node-schedule)) | Object | | -| `cron.enabled` | Enable or disable [CRON jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) to schedule jobs at specific dates. | boolean | `false` | -| `cron.tasks` | Declare [CRON jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) to be run at specific dates. | boolean | `false` | diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment.md b/docs/developer-docs/latest/setup-deployment-guides/deployment.md index 8d7808aa6e..b6614a60e0 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment.md @@ -1,6 +1,7 @@ --- -title: Deployment - Strapi Developer Documentation +title: Deployment - Strapi Developer Docs description: Learn how to develop locally with Strapi and deploy Strapi with various hosting options. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment.html --- # Deployment diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md index 8ba38f6e78..6719e9a2ec 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md @@ -1,10 +1,13 @@ --- -title: 21YunBox Deployment - Strapi Developer Documentation +title: 21YunBox Deployment - Strapi Developer Docs description: Learn in this guide how to update an existing Strapi project so it can be deployed on 21YunBox. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.html --- # 21YunBox +!!!include(developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md)!!! + This guide explains how to update an existing Strapi project so it can be deployed on [21YunBox](https://www.21yunbox.com). 21YunBox provides a Chinese CDN, continuous deployment, one-click HTTPS and [other services such as managed databases and backend web services](https://www.21yunbox.com/docs/#/), allowing to launch web projects in China. diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md index 44e368d3ea..879db3b39b 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md @@ -1,10 +1,13 @@ --- -title: AWS Deployment - Strapi Developer Documentation +title: AWS Deployment - Strapi Developer Docs description: Learn in this guide how to deploy your Strapi application on AWS EC2, host your database on AWS RDS and upload your assets on AWS S3. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.html --- # Amazon AWS +!!!include(developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md)!!! + This is a step-by-step guide for deploying a Strapi project to [Amazon AWS EC2](https://aws.amazon.com/ec2/). This guide will connect to an [Amazon AWS RDS](https://aws.amazon.com/rds/) for managing and hosting the database. Optionally, this guide will show you how to connect host and serve images on [Amazon AWS S3](https://aws.amazon.com/s3/). Prior to starting this guide, you should have created a [Strapi project](/developer-docs/latest/getting-started/quick-start.md), to use for deploying on AWS. And have read through the [configuration](/developer-docs/latest/setup-deployment-guides/deployment.md#application-configuration) section. diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md index 790d0f10ce..60110308de 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md @@ -1,10 +1,13 @@ --- -title: Azure Deployment - Strapi Developer Documentation +title: Azure Deployment - Strapi Developer Docs description: Learn in this guide how to deploy your Strapi application on Microsoft Azure. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.html --- # Azure +!!!include(developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md)!!! + This is a step-by-step guide for deploying a Strapi project to [Azure](https://azure.microsoft.com/en-us/). Databases can be on a [Azure Virtual Machine](https://azure.microsoft.com/en-us/services/virtual-machines/), hosted externally as a service, or via the [Azure Managed Databases](https://azure.microsoft.com/en-us/services/postgresql/). Prior to starting this guide, you should have created a [Strapi project](/developer-docs/latest/getting-started/quick-start.md). And have read through the [configuration](/developer-docs/latest/setup-deployment-guides/deployment.md#application-configuration) section. ### Azure Install Requirements diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md index ce44d4f53a..2511c79b08 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md @@ -1,10 +1,13 @@ --- -title: DigitalOcean App Platform Deployment - Strapi Developer Documentation +title: DigitalOcean App Platform Deployment - Strapi Developer Docs description: Learn in this guide how to deploy your Strapi application on DigitalOcean App Platform. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.html --- # DigitalOcean App Platform +!!!include(developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md)!!! + This is a step-by-step guide for deploying a Strapi project to [DigitalOcean's App Platform](https://digitalocean.com). App Platform is DigitalOcean's Platform as a Service (PaaS) that will handle deploying, networking, SSL, and more for your app. It is the easiest way to deploy Strapi to DigitalOcean. Databases can be created using DigitalOcean's [Managed Databases](https://www.digitalocean.com/products/managed-databases/). diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md index ac244794a5..e1027760ff 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md @@ -1,10 +1,13 @@ --- -title: DigitalOcean Droplet Deployment - Strapi Developer Documentation +title: DigitalOcean Droplet Deployment - Strapi Developer Docs description: Learn in this guide how to deploy your Strapi application on DigitalOcean Droplets. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.html --- # DigitalOcean Droplets +!!!include(developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md)!!! + This is a step-by-step guide for deploying a Strapi project to [DigitalOcean](https://www.digitalocean.com/) Droplet. If you want to deploy your Strapi project from GitHub, you can deploy to DigitalOcean's Platform as a Service (PaaS) called [App Platform](/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md). Databases can be on a [DigitalOcean Droplet](https://www.digitalocean.com/docs/droplets/) or hosted externally as a service using [DigitalOcean Managed Databases](https://www.digitalocean.com/products/managed-databases/). diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md index 79c81cefea..53924d2b63 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md @@ -1,10 +1,13 @@ --- -title: Google App Engine Deployment - Strapi Developer Documentation +title: Google App Engine Deployment - Strapi Developer Docs description: Learn in this guide how to deploy your Strapi application on Google App Engine and how to upload your assets on Google Cloud Storage. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.html --- # Google App Engine +!!!include(developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md)!!! + In this guide we are going to: - Create a new Strapi project @@ -14,12 +17,11 @@ In this guide we are going to: ### New Strapi project - ```sh -npx create-strapi-app my-project --quickstart +npx create-strapi-app@latest my-project --quickstart ``` @@ -31,7 +33,6 @@ yarn create strapi-app my-project --quickstart - When the setup completes, register an admin user using the form which opens in the browser. This user will be only relevant in local development. The `sqlite` database is created at `.tmp/data.db`. diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md index d8adff1d0a..12ae138787 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md @@ -1,10 +1,13 @@ --- -title: Heroku Deployment - Strapi Developer Documentation +title: Heroku Deployment - Strapi Developer Docs description: Learn in this guide how to deploy your Strapi application on Heroku. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.html --- # Heroku +!!!include(developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md)!!! + This is a step-by-step guide for deploying a Strapi project on [Heroku](https://www.heroku.com/). Databases that work well with Strapi and Heroku are provided instructions on how to get started. ### Heroku Install Requirements @@ -69,7 +72,7 @@ Create a [new Strapi project](/developer-docs/latest/getting-started/quick-start ```sh -npx create-strapi-app my-project --quickstart +npx create-strapi-app@latest my-project --quickstart ``` @@ -257,7 +260,6 @@ Unless you originally installed Strapi with PostgreSQL, you need to install the `Path: ./my-project/` - @@ -357,7 +359,7 @@ As of version `3.2.1`, Strapi uses [`koa-compress`](https://github.com/koajs/com To disable Brotli, provide the following configuration in `config/middleware.js`. -```jsonify +```json gzip: { enabled: true, options: { diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md index 723fdb59a8..ee8e9b8fa7 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md @@ -1,10 +1,13 @@ --- -title: Qovery Deployment - Strapi Developer Documentation +title: Qovery Deployment - Strapi Developer Docs description: Learn in this guide how to deploy your Strapi application on Qovery. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.html --- # Qovery +!!!include(developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md)!!! + This is a step-by-step guide for deploying a Strapi project on [Qovery](https://www.qovery.com). Qovery is a CaaS for developers to deploy their full-stack applications on AWS, GCP, Azure and Digital Ocean. Qovery provides access to managed PostgreSQL and free SSL. diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md index 5950c8b7cc..a8e3aa2f8a 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md @@ -1,16 +1,19 @@ --- -title: Render Deployment - Strapi Developer Documentation +title: Render Deployment - Strapi Developer Docs description: Learn in this guide how to deploy your Strapi application on Render. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.html --- # Render +!!!include(developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md)!!! + This guide explains how to update an existing Strapi project so it can be deployed on [Render](https://render.com). With persistent disks and managed PostgreSQL databases, Render gives you multiple different ways to store your content. Render services come with fully managed SSL, so it's no longer necessary to set up a proxy server to secure your Strapi app. Since Render services are automatically restarted if they become unresponsive, you don't need to use a process manager like `pm2` either. ::: tip -For more information consult [Render's Deploy Strapi guide](https://render.com/docs/deploy-strapi) +For more information consult [Render's Deploy Strapi guide](https://render.com/docs/deploy-strapi). ::: ### Step 1: Create a Render Account diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md index 6fb6c77176..feb699f89f 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md @@ -1,6 +1,7 @@ --- -title: Caddy Proxying - Strapi Developer Documentation +title: Caddy Proxying - Strapi Developer Docs description: Learn how you can use a proxy application like Caddy to secure your Strapi application. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.html --- # Caddy Proxying diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md index cc5047441e..f60ba8a624 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md @@ -1,6 +1,7 @@ --- -title: HAProxy Proxying - Strapi Developer Documentation +title: HAProxy Proxying - Strapi Developer Docs description: Learn how you can use a proxy application like HAProxy to secure your Strapi application. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.html --- # HAProxy Proxying diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md index 827ef839dd..724f9c2ed3 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md @@ -1,6 +1,7 @@ --- -title: Nginx Proxying - Strapi Developer Documentation +title: Nginx Proxying - Strapi Developer Docs description: Learn how you can use a proxy application like Nginx to secure your Strapi application. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.html --- # Nginx Proxying diff --git a/docs/developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md b/docs/developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md new file mode 100644 index 0000000000..d2fadc8b00 --- /dev/null +++ b/docs/developer-docs/latest/setup-deployment-guides/deployment/snippets/deployment-guide-not-updated.md @@ -0,0 +1,3 @@ +::: caution +This third-party deployment guide might not be up-to-date with Strapi v4. [Contributions](https://github.com/strapi/documentation/blob/main/CONTRIBUTING.md) are most welcome. +::: diff --git a/docs/developer-docs/latest/setup-deployment-guides/file-structure.md b/docs/developer-docs/latest/setup-deployment-guides/file-structure.md index 4c05ed5e22..3b4b0394c1 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/file-structure.md +++ b/docs/developer-docs/latest/setup-deployment-guides/file-structure.md @@ -1,6 +1,7 @@ --- -title: Project Structure - Strapi Developer Documentation +title: Project Structure - Strapi Developer Docs description: Discover the project structure of any default Strapi application. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/file-structure.html ---