From bdbd659a71ac0f54fcb7143b34a69e67ba877bf2 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Mon, 3 Jan 2022 10:19:04 +0100 Subject: [PATCH] docs(chore): indent code block properly. --- .../how-to/how-to-use-custom-strategies.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/website/docs/how-to/how-to-use-custom-strategies.md b/website/docs/how-to/how-to-use-custom-strategies.md index bcc7e94cb2..6d965d1ac0 100644 --- a/website/docs/how-to/how-to-use-custom-strategies.md +++ b/website/docs/how-to/how-to-use-custom-strategies.md @@ -162,32 +162,32 @@ The Unleash Proxy accepts a `customStrategies` property as part of its initializ 3. **Pass the strategy to the Proxy Client** using the **`customStrategies`** option. A full code example: -``` javascript -const { createApp } = require('@unleash/proxy'); -const { Strategy } = require('unleash-client'); + ``` javascript + const { createApp } = require('@unleash/proxy'); + const { Strategy } = require('unleash-client'); -class TimeStampStrategy extends Strategy { - constructor() { - super('TimeStamp'); - } + class TimeStampStrategy extends Strategy { + constructor() { + super('TimeStamp'); + } - isEnabled(parameters, context) { - return Date.parse(parameters.enableAfter) > Date.now(); - } -} + isEnabled(parameters, context) { + return Date.parse(parameters.enableAfter) > Date.now(); + } + } -const port = 3000; + const port = 3000; -const app = createApp({ - unleashUrl: 'https://app.unleash-hosted.com/demo/api/', - unleashApiToken: '*:default.56907a2fa53c1d16101d509a10b78e36190b0f918d9f122d', - proxySecrets: ['proxy-secret', 'another-proxy-secret', 's1'], - refreshInterval: 1000, - customStrategies: [new TimeStampStrategy()] -}); + const app = createApp({ + unleashUrl: 'https://app.unleash-hosted.com/demo/api/', + unleashApiToken: '*:default.56907a2fa53c1d16101d509a10b78e36190b0f918d9f122d', + proxySecrets: ['proxy-secret', 'another-proxy-secret', 's1'], + refreshInterval: 1000, + customStrategies: [new TimeStampStrategy()] + }); -app.listen(port, () => - // eslint-disable-next-line no-console - console.log(`Unleash Proxy listening on http://localhost:${port}/proxy`), -); -``` + app.listen(port, () => + // eslint-disable-next-line no-console + console.log(`Unleash Proxy listening on http://localhost:${port}/proxy`), + ); + ```