From 28d12b5dc214bc10147cc9e82cdee63fd6709fdc Mon Sep 17 00:00:00 2001 From: nathan-pichon Date: Tue, 4 Apr 2023 15:34:33 +0200 Subject: [PATCH] docs(api-ref): add config container description --- docs/docs/api/Strapi.mdx | 96 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/docs/docs/api/Strapi.mdx b/docs/docs/api/Strapi.mdx index 91636d2f5b..e66ebcd109 100644 --- a/docs/docs/api/Strapi.mdx +++ b/docs/docs/api/Strapi.mdx @@ -334,96 +334,192 @@ See the [sanitizers' container](#sanitizers). ### `strapi.start()` - Returns: Promise +//TODO + ### `strapi.destroy()` - Returns: Promise +//TODO + ### `strapi.sendStartupTelemetry()` +//TODO + ### `strapi.openAdmin({ isInitialized })` - Returns: Promise +//TODO + ### `strapi.postListen()` - Returns: Promise +//TODO + ### `strapi.listen()` - Returns: Promise +//TODO + ### `strapi.stopWithError()` +//TODO + ### `strapi.stop(exitCode)` +//TODO + ### `strapi.loadAdmin()` - Returns: Promise +//TODO + ### `strapi.loadPlugins()` - Returns: Promise +//TODO + ### `strapi.loadPolicies()` - Returns: Promise +//TODO + ### `strapi.loadAPIs()` - Returns: Promise +//TODO + ### `strapi.loadComponents()` - Returns: Promise +//TODO + ### `strapi.loadMiddlewares()` - Returns: Promise +//TODO + ### `strapi.loadApp()` - Returns: Promise +//TODO + ### `strapi.loadSanitizers()` - Returns: Promise +//TODO + ### `strapi.registerInternalHooks()` +//TODO + ### `strapi.register()` - Returns: Promise +//TODO + ### `strapi.bootstrap()` - Returns: Promise +//TODO + ### `strapi.load()` - Returns: Promise +//TODO + ### `strapi.startWebhooks()` - Returns: Promise +//TODO + ### `strapi.reload()` +//TODO + ### `strapi.runLifecyclesFunctions()` - Returns: Promise +//TODO + ### `strapi.getModel(uid)` - `uid`: String +//TODO + ### `strapi.query(uid)` - `uid`: String +//TODO + ## Strapi containers The strapi containers are accessible via `strapi.container.get('name-of-the-container')`. ### `config` +- Object + + - `get(path, defaultValue)`: Function + - `path`: String + - `defaultValue`: Any + - Returns: Any - The value located at `path` or, if undefined, `defaultValue`. + - `set(path, value)`: Function + - `path`: String - Where the value should be stored + - `value`: Any + - `has(path)`: Function + - `path`: String + - Returns: Boolean - Does the `path` match a value stored in the config container. + - `launchedAt`: Number **Default:** `Date.now()` + Date in milliseconds when the server has started + - `serveAdminPanel`: Boolean **Default:** `true` + See [Strapi constructor](#new-strapiopts) options + - `autoReload`: Boolean **Default:** `false` + See [Strapi constructor](#new-strapiopts) options + - `environment`: String - process.env.NODE_ENV + - `uuid`: String - string extracted from `package.json` located in `strapi.uuid` + - `packageJsonStrapi`: Object - object extracted from `package.json` located in `strapi` (except uuid) + - `info`: Object + - everything stored in the `package.json` + - `strapi`: String - Current version of Strapi + +Every file stored under the `config` folder will be injected in this config container object. ### `services` +//TODO + ### `controllers` +//TODO + ### `content-types` +//TODO + ### `policies` +//TODO + ### `plugins` +//TODO + ### `hooks` +//TODO + ### `apis` +//TODO + ### `auth` +//TODO + ### `content-api` +//TODO + ### `sanitizers` +//TODO +