diff --git a/docs/docs/api/Strapi.mdx b/docs/docs/api/Strapi.mdx index 9111fa8575..1f598498ef 100644 --- a/docs/docs/api/Strapi.mdx +++ b/docs/docs/api/Strapi.mdx @@ -171,4 +171,14 @@ Module to schedule cron jobs for Strapi project. It is an instance of a custom C The `strapi.telemetry` property provides access to the telemetry service instance. This service collects anonymous usage data about your Strapi application to help the Strapi team improve the product. -By default, the telemetry service is enabled, but you can disable it by setting the telemetryDisabled property to true in your application's package.json file, or by setting the `STRAPI_TELEMETRY_DISABLED` environment variable to true. You can also disable telemetry programmatically by setting the isDisabled property of the `strapi.telemetry` instance to true. \ No newline at end of file +By default, the telemetry service is enabled, but you can disable it by setting the telemetryDisabled property to true in your application's package.json file, or by setting the `STRAPI_TELEMETRY_DISABLED` environment variable to true. You can also disable telemetry programmatically by setting the isDisabled property of the `strapi.telemetry` instance to true. + +### `strapi.requestContext` +- Object - Context Storage + - 'run(store, cb)': Function + - 'store': Any - Value that should be retrieved + - 'cb': Function - Callback + - 'get()': Function + +The request context stores the ctx object from KoaJS on each request. This allows users to have access to the context from anywhere through the Strapi instance. + diff --git a/packages/core/strapi/lib/Strapi.js b/packages/core/strapi/lib/Strapi.js index f26260827f..4ea71bf49f 100644 --- a/packages/core/strapi/lib/Strapi.js +++ b/packages/core/strapi/lib/Strapi.js @@ -109,27 +109,13 @@ class Strapi { // Instantiate the Koa app & the HTTP server this.server = createServer(this); - // Strapi utils instanciation + // Strapi utils instantiation this.fs = createStrapiFs(this); - this.eventHub = createEventHub(); - this.startupLogger = createStartupLogger(this); - this.log = createLogger(this.config.get('logger', {})); - this.cron = createCronService(); - - /** - * Service used to send statistical data to Amplitude - */ this.telemetry = createTelemetry(this); - - // TODO put this in /docs/docs/API/Strapi - /** - * TODO ask JS | Alex - * Wrapper around async_hooks AsyncLocalStorage - */ this.requestContext = requestContext; // TODO put this in /docs/docs/API/Strapi