mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 09:56:44 +00:00 
			
		
		
		
	docs(api-ref): add config container description
This commit is contained in:
		
							parent
							
								
									907f2f57d3
								
							
						
					
					
						commit
						28d12b5dc2
					
				| @ -334,96 +334,192 @@ See the [sanitizers' container](#sanitizers). | |||||||
| ### `strapi.start()` | ### `strapi.start()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.destroy()` | ### `strapi.destroy()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.sendStartupTelemetry()` | ### `strapi.sendStartupTelemetry()` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.openAdmin({ isInitialized })` | ### `strapi.openAdmin({ isInitialized })` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.postListen()` | ### `strapi.postListen()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.listen()` | ### `strapi.listen()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.stopWithError()` | ### `strapi.stopWithError()` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.stop(exitCode)` | ### `strapi.stop(exitCode)` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.loadAdmin()` | ### `strapi.loadAdmin()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.loadPlugins()` | ### `strapi.loadPlugins()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.loadPolicies()` | ### `strapi.loadPolicies()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.loadAPIs()` | ### `strapi.loadAPIs()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.loadComponents()` | ### `strapi.loadComponents()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.loadMiddlewares()` | ### `strapi.loadMiddlewares()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.loadApp()` | ### `strapi.loadApp()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.loadSanitizers()` | ### `strapi.loadSanitizers()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.registerInternalHooks()` | ### `strapi.registerInternalHooks()` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.register()` | ### `strapi.register()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.bootstrap()` | ### `strapi.bootstrap()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.load()` | ### `strapi.load()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.startWebhooks()` | ### `strapi.startWebhooks()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.reload()` | ### `strapi.reload()` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.runLifecyclesFunctions()` | ### `strapi.runLifecyclesFunctions()` | ||||||
| - Returns: Promise | - Returns: Promise | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.getModel(uid)` | ### `strapi.getModel(uid)` | ||||||
| - `uid`: <Type>String</Type> | - `uid`: <Type>String</Type> | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `strapi.query(uid)` | ### `strapi.query(uid)` | ||||||
| - `uid`: <Type>String</Type> | - `uid`: <Type>String</Type> | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ## Strapi containers | ## Strapi containers | ||||||
| 
 | 
 | ||||||
| The strapi containers are accessible via `strapi.container.get('name-of-the-container')`. | The strapi containers are accessible via `strapi.container.get('name-of-the-container')`. | ||||||
| 
 | 
 | ||||||
| ### `config` | ### `config` | ||||||
|  | - <Type>Object</Type> | ||||||
|  | 
 | ||||||
|  |   - `get(path, defaultValue)`: <Type>Function</Type> | ||||||
|  |     - `path`: <Type>String</Type> | ||||||
|  |     - `defaultValue`: <Type>Any</Type> | ||||||
|  |     - Returns: <Type>Any</Type> - The value located at `path` or, if undefined, `defaultValue`. | ||||||
|  |   - `set(path, value)`: <Type>Function</Type> | ||||||
|  |     - `path`: <Type>String</Type> - Where the value should be stored | ||||||
|  |     - `value`: <Type>Any</Type> | ||||||
|  |   - `has(path)`: <Type>Function</Type> | ||||||
|  |     - `path`: <Type>String</Type> | ||||||
|  |     - Returns: <Type>Boolean</Type> - Does the `path` match a value stored in the config container. | ||||||
|  |   - `launchedAt`: <Type>Number</Type>  **Default:** `Date.now()` | ||||||
|  |     Date in milliseconds when the server has started | ||||||
|  |   - `serveAdminPanel`: <Type>Boolean</Type> **Default:** `true` | ||||||
|  |     See [Strapi constructor](#new-strapiopts) options | ||||||
|  |   - `autoReload`: <Type>Boolean</Type> **Default:** `false` | ||||||
|  |     See [Strapi constructor](#new-strapiopts) options | ||||||
|  |   - `environment`: <Type>String</Type> - process.env.NODE_ENV | ||||||
|  |   - `uuid`: <Type>String</Type> - string extracted from `package.json` located in `strapi.uuid` | ||||||
|  |   - `packageJsonStrapi`: <Type>Object</Type> - object extracted from `package.json` located in `strapi` (except uuid) | ||||||
|  |   - `info`: <Type>Object</Type> | ||||||
|  |     - everything stored in the `package.json` | ||||||
|  |     - `strapi`: <Type>String</Type> - Current version of Strapi | ||||||
|  | 
 | ||||||
|  | Every file stored under the `config` folder will be injected in this config container object. | ||||||
| 
 | 
 | ||||||
| ### `services` | ### `services` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `controllers` | ### `controllers` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `content-types` | ### `content-types` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `policies` | ### `policies` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `plugins` | ### `plugins` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `hooks` | ### `hooks` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `apis` | ### `apis` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `auth` | ### `auth` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `content-api` | ### `content-api` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
| ### `sanitizers` | ### `sanitizers` | ||||||
| 
 | 
 | ||||||
|  | //TODO | ||||||
|  | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 nathan-pichon
						nathan-pichon