From ead7a372b3f23f0f6035e18aabc3f7672f9bf272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Huan=20LI=20=28=E6=9D=8E=E5=8D=93=E6=A1=93=29?= Date: Thu, 11 Feb 2021 17:45:44 +0800 Subject: [PATCH] clean codesandbox --- examples/.code-sandbox.js | 26 -------------------------- examples/ding-dong-bot.js | 5 ----- examples/ding-dong-bot.ts | 3 --- 3 files changed, 34 deletions(-) delete mode 100644 examples/.code-sandbox.js diff --git a/examples/.code-sandbox.js b/examples/.code-sandbox.js deleted file mode 100644 index dda6795..0000000 --- a/examples/.code-sandbox.js +++ /dev/null @@ -1,26 +0,0 @@ -const isCodeSandbox = () => Object.keys(process.env).filter(k => /KUBERNETES/i.test(k)).length > 0 - -if (isCodeSandbox()) { - /** - * A quick webserver - */ - const path = require('path') - const fs = require('fs') - - const connect = require('connect') - const marked = require('marked') - - const readme = path.join( - __dirname, - '..', - '..', - 'README.md', - ) - - connect() - .use((_, res) => res.end(marked(fs.readFileSync(readme).toString()))) - .listen(8080, function() { - console.info('Web Server running on 8080...') - }) -} - diff --git a/examples/ding-dong-bot.js b/examples/ding-dong-bot.js index 1e5ceeb..fea8371 100644 --- a/examples/ding-dong-bot.js +++ b/examples/ding-dong-bot.js @@ -8,11 +8,6 @@ const { log, } = require('wechaty') -/** - * You can ignore the next line becasue it is using for CodeSandbox - */ -require('./.code-sandbox.js') - function onScan (qrcode, status) { if (status === ScanStatus.Waiting || status === ScanStatus.Timeout) { require('qrcode-terminal').generate(qrcode, { small: true }) // show qrcode on console diff --git a/examples/ding-dong-bot.ts b/examples/ding-dong-bot.ts index f699b37..6435720 100644 --- a/examples/ding-dong-bot.ts +++ b/examples/ding-dong-bot.ts @@ -14,9 +14,6 @@ import { generate } from 'qrcode-terminal' require('dotenv').config() -// You can safely ignore / comment out the next two lines because it is using for CodeSandbox -require('./.code-sandbox.js') - function onScan (qrcode: string, status: ScanStatus) { if (status === ScanStatus.Waiting || status === ScanStatus.Timeout) { generate(qrcode, { small: true }) // show qrcode on console