From f47c82f16e15b92d2f4bb7aab8429fd29f7b4f4c Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 17 Jan 2023 16:12:48 +0100 Subject: [PATCH] docs/backend-system: core service doc tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Co-authored-by: Johan Haals Signed-off-by: Patrik Oldsberg --- docs/backend-system/core-services/01-index.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/backend-system/core-services/01-index.md b/docs/backend-system/core-services/01-index.md index 875227f0c4..cb1ec157ae 100644 --- a/docs/backend-system/core-services/01-index.md +++ b/docs/backend-system/core-services/01-index.md @@ -38,6 +38,7 @@ createBackendPlugin({ router.get('/hello', (_req, res) => { res.status(200).json({ hello: 'world' }); }); + // Registers the router at the /api/example path http.use(router); }, }); @@ -47,7 +48,7 @@ createBackendPlugin({ ## Logging and Configuration Service -It is common for plugins to need access to configuration values and log. +It is common for plugins to need access to configuration values and log messages. ```ts import { @@ -61,13 +62,13 @@ createBackendPlugin({ register(env) { env.registerInit({ deps: { - logger: coreServices.logger, + log: coreServices.logger, config: coreServices.config, }, - - async init({ config, logger }) { + async init({ config, log }) { + log.warn('Brace yourself for more log output'); const url = config.getString('backend.baseUrl'); - c; + log.info(`Backend URL is running on ${url}`); }, }); },