diff --git a/docs/3.0.0-beta.x/cli/CLI.md b/docs/3.0.0-beta.x/cli/CLI.md index 68be90962f..c363d82d5b 100644 --- a/docs/3.0.0-beta.x/cli/CLI.md +++ b/docs/3.0.0-beta.x/cli/CLI.md @@ -6,7 +6,7 @@ Strapi comes with a full featured Command Line Interface (CLI) which lets you sc ## strapi new -Create a new project +Create a new project. ```bash strapi new @@ -33,33 +33,33 @@ options: [--debug|--quickstart|--dbclient= --dbhost= --dbport= ## strapi develop|dev -Start a Strapi application with autoReload activated. +Start a Strapi application with autoReload enabled. Strapi modifies/creates files at runtime and needs to restart when new files are created. To achieve this, `strapi develop` adds a file watcher and restarts the application when necessary. ::: note -You should never use this command to run a Strapi application in production +You should never use this command to run a Strapi application in production. ::: ## strapi start -Start a Strapi application without autoReloading. +Start a Strapi application with autoReload disabled. This commands is there to run a Strapi application without restarts and file writes (aimed at production usage). -When run certain features are disabled because they require application restarts. +Certain features are disabled in the `strapi start` mode because they require application restarts. ::: note -You can specify a NODE_ENV to use the configurations in the `./config/envrionments` folder (e.g development|staging|production) -By default the `development` envrionment will be used +You can specify a NODE_ENV to use the configurations in the `./config/environments/[development|staging|production]` folder. +By default the `development` envrionment will be used. ::: ## strapi build -Builds your admin panel +Builds your admin panel. ::: note -You can specify a NODE_ENV to use the configurations in the `./config/envrionments` folder (e.g development|staging|production) -By default the `development` envrionment will be used +You can specify a NODE_ENV to use the configurations in the `./config/environments/[development|staging|production]` folder. +By default the `development` envrionment will be used. ::: ## strapi generate:api @@ -96,7 +96,7 @@ The first letter of the filename will be uppercased. ## strapi generate:controller -Create a new controller +Create a new controller. ```bash strapi generate:controller @@ -123,7 +123,7 @@ The first letter of the filename will be uppercased. ## strapi generate:model -Create a new model +Create a new model. ```bash strapi generate:model [] @@ -159,7 +159,7 @@ The first letter of the filename will be uppercased. ## strapi generate:service -Create a new service +Create a new service. ```bash strapi generate:service @@ -186,7 +186,7 @@ The first letter of the filename will be uppercased. ## strapi generate:policy -Create a new policy +Create a new policy. ```bash strapi generate:policy diff --git a/docs/3.0.0-beta.x/guides/services.md b/docs/3.0.0-beta.x/guides/services.md index 4d1e3ec78f..d7900a0ce5 100644 --- a/docs/3.0.0-beta.x/guides/services.md +++ b/docs/3.0.0-beta.x/guides/services.md @@ -11,7 +11,7 @@ When you create a new Content type or a new model. You will see a new empty serv Here are the core methods (and their current implementation). You can simply copy and paste this code to your own service file to customize the methods. -Youc an read about `strapi.query` calls [here](./queries.md) +You can read about `strapi.query` calls [here](./queries.md) ::: warning In the following example your controller, service and model is named `product` diff --git a/packages/strapi-plugin-documentation/services/Documentation.js b/packages/strapi-plugin-documentation/services/Documentation.js index 1f18253dae..3eb1c6bfbb 100755 --- a/packages/strapi-plugin-documentation/services/Documentation.js +++ b/packages/strapi-plugin-documentation/services/Documentation.js @@ -10,7 +10,6 @@ const path = require('path'); const _ = require('lodash'); const moment = require('moment'); const pathToRegexp = require('path-to-regexp'); -const settings = require('../config/settings.json'); const defaultComponents = require('./utils/components.json'); const form = require('./utils/forms.json'); const parametersOptions = require('./utils/parametersOptions.json'); @@ -494,7 +493,7 @@ module.exports = { const apisDoc = this.retrieveDocumentationFiles(false, version); const pluginsDoc = this.retrieveDocumentationFiles(true, version); const appDoc = [...apisDoc, ...pluginsDoc]; - const defaultSettings = _.cloneDeep(settings); + const defaultSettings = _.cloneDeep(strapi.plugins.documentation.config); _.set(defaultSettings, ['info', 'x-generation-date'], moment().format('L LTS')); _.set(defaultSettings, ['info', 'version'], version); const tags = appDoc.reduce((acc, current) => { diff --git a/packages/strapi/lib/Strapi.js b/packages/strapi/lib/Strapi.js index 88a5ddbb65..ad3911547c 100644 --- a/packages/strapi/lib/Strapi.js +++ b/packages/strapi/lib/Strapi.js @@ -4,6 +4,7 @@ const http = require('http'); const path = require('path'); const { EventEmitter } = require('events'); +const fse = require('fs-extra'); const Koa = require('koa'); const _ = require('lodash'); const { logger, models } = require('strapi-utils'); @@ -102,6 +103,17 @@ class Strapi extends EventEmitter { this.fs = createStrapiFs(this); } + requireProjectBootstrap() { + const bootstrapPath = path.resolve( + this.dir, + 'config/functions/bootstrap.js' + ); + + if (fse.existsSync(bootstrapPath)) { + require(bootstrapPath); + } + } + async start(cb) { try { // Emit starting event.