From 1c66bca379c566942efe68cb4631fe0b2c139426 Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Wed, 22 Feb 2023 09:34:19 -0800 Subject: [PATCH 01/10] amazee.io rocks you --- docker-compose.yml | 2 +- index.js | 16 ---------------- package.json | 2 +- src/index.js | 21 +++++++++++++++++++++ 4 files changed, 23 insertions(+), 18 deletions(-) delete mode 100644 index.js create mode 100644 src/index.js diff --git a/docker-compose.yml b/docker-compose.yml index 48a7c45..9761437 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: labels: lagoon.type: node volumes: - - .:/app:delegated + - ./src:/app/src:delegated environment: - LAGOON_LOCALDEV_HTTP_PORT=3000 - LAGOON_ROUTE=http://node.docker.amazee.io diff --git a/index.js b/index.js deleted file mode 100644 index 7b74fd8..0000000 --- a/index.js +++ /dev/null @@ -1,16 +0,0 @@ -const express = require('express') -const app = express() - -app.get('/', function (req, res) { - let result = [] - Object.keys(process.env).map(key => { - result.push(`${key}=${process.env[key]}`) - }) - result.sort() - res.header('X-LAGOON' , process.env.HOSTNAME ) - res.send(result.join("
")) -}) - -app.listen(3000, function () { - console.log('Example app listening on port 3000!') -}) diff --git a/package.json b/package.json index a16c5e6..03824b7 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,6 @@ "express": "^4.17.1" }, "scripts": { - "start": "node index.js" + "start": "node src/index.js" } } diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..42b7866 --- /dev/null +++ b/src/index.js @@ -0,0 +1,21 @@ +const express = require('express') +const app = express() + +app.get('/', function (req, res) { + let result = [] + result.push(`
+   █████  ███    ███  █████  ███████ ███████ ███████    ██  ██████      ██████   ██████   ██████ ██   ██ ███████     ██    ██  ██████  ██    ██
+  ██   ██ ████  ████ ██   ██    ███  ██      ██         ██ ██    ██     ██   ██ ██    ██ ██      ██  ██  ██           ██  ██  ██    ██ ██    ██
+  ███████ ██ ████ ██ ███████   ███   █████   █████      ██ ██    ██     ██████  ██    ██ ██      █████   ███████       ████   ██    ██ ██    ██
+  ██   ██ ██  ██  ██ ██   ██  ███    ██      ██         ██ ██    ██     ██   ██ ██    ██ ██      ██  ██       ██        ██    ██    ██ ██    ██
+  ██   ██ ██      ██ ██   ██ ███████ ███████ ███████ ██ ██  ██████      ██   ██  ██████   ██████ ██   ██ ███████        ██     ██████   ██████
+
+

+ `) + res.header('X-LAGOON' , process.env.HOSTNAME ) + res.send(result.join("
")) +}) + +app.listen(3000, function () { + console.log('Example app listening on port 3000!') +}) From c8f90b2ceb4cba2b1ec4770a5292bbeccedfe6df Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Wed, 22 Feb 2023 09:47:22 -0800 Subject: [PATCH 02/10] add nodemon --- docker-compose.yml | 1 + package.json | 6 +++++- src/mirantis.txt | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/mirantis.txt diff --git a/docker-compose.yml b/docker-compose.yml index 9761437..25d33f5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ services: build: context: . dockerfile: node.dockerfile + command: yarn run dev labels: lagoon.type: node volumes: diff --git a/package.json b/package.json index 03824b7..2bfca52 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,10 @@ "express": "^4.17.1" }, "scripts": { - "start": "node src/index.js" + "start": "node src/index.js", + "dev": "nodemon src/index.js" + }, + "devDependencies": { + "nodemon": "^2.0.20" } } diff --git a/src/mirantis.txt b/src/mirantis.txt new file mode 100644 index 0000000..1630a98 --- /dev/null +++ b/src/mirantis.txt @@ -0,0 +1,6 @@ +███ ███ ██ ██████ █████ ███ ██ ████████ ██ ███████ ██████ ██████ ██████ ██ ██ ███████ ██ ██ ██████ ██ ██ +████ ████ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +██ ████ ██ ██ ██████ ███████ ██ ██ ██ ██ ██ ███████ ██████ ██ ██ ██ █████ ███████ ████ ██ ██ ██ ██ +██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ███████ ██ ██ ██████ ██████ ██ ██ ███████ ██ ██████ ██████ + From e3d4b23abab111aae271af61c390e33f052c149e Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Wed, 22 Feb 2023 09:50:56 -0800 Subject: [PATCH 03/10] hello world --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 42b7866..0ae67e0 100644 --- a/src/index.js +++ b/src/index.js @@ -9,7 +9,7 @@ app.get('/', function (req, res) { ███████ ██ ████ ██ ███████ ███ █████ █████ ██ ██ ██ ██████ ██ ██ ██ █████ ███████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ███████ ███████ ██ ██ ██████ ██ ██ ██████ ██████ ██ ██ ███████ ██ ██████ ██████ - +Hello World
`) res.header('X-LAGOON' , process.env.HOSTNAME ) From 381abcda7db35de621481c9545f55bf5347543ca Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Wed, 22 Feb 2023 11:55:52 -0800 Subject: [PATCH 04/10] no hello world --- src/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.js b/src/index.js index 0ae67e0..9f26b97 100644 --- a/src/index.js +++ b/src/index.js @@ -9,7 +9,6 @@ app.get('/', function (req, res) { ███████ ██ ████ ██ ███████ ███ █████ █████ ██ ██ ██ ██████ ██ ██ ██ █████ ███████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ███████ ███████ ███████ ██ ██ ██████ ██ ██ ██████ ██████ ██ ██ ███████ ██ ██████ ██████ -Hello World
`) res.header('X-LAGOON' , process.env.HOSTNAME ) From 52b4244f7573721aba2e576b85c23122f78ff604 Mon Sep 17 00:00:00 2001 From: Bryan Gruneberg Date: Mon, 27 Feb 2023 11:05:08 -0800 Subject: [PATCH 05/10] Docker change --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 25d33f5..e635031 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: - ./src:/app/src:delegated environment: - LAGOON_LOCALDEV_HTTP_PORT=3000 - - LAGOON_ROUTE=http://node.docker.amazee.io + - LAGOON_ROUTE=http://demo-node-simple.docker.amazee.io networks: amazeeio-network: From dda4d3c95821173825f25313c311916d8d79344d Mon Sep 17 00:00:00 2001 From: Bryan Gruneberg Date: Mon, 27 Feb 2023 11:08:18 -0800 Subject: [PATCH 06/10] Some Options --- src/amazee.txt | 5 +++++ src/index.js.amazee | 20 ++++++++++++++++++++ src/index.js.mirantis | 21 +++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 src/amazee.txt create mode 100644 src/index.js.amazee create mode 100644 src/index.js.mirantis diff --git a/src/amazee.txt b/src/amazee.txt new file mode 100644 index 0000000..13d6a73 --- /dev/null +++ b/src/amazee.txt @@ -0,0 +1,5 @@ + █████ ███ ███ █████ ███████ ███████ ███████ ██ ██████ ██████ ██████ ██████ ██ ██ ███████ ██ ██ ██████ ██ ██ + ██ ██ ████ ████ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ + ███████ ██ ████ ██ ███████ ███ █████ █████ ██ ██ ██ ██████ ██ ██ ██ █████ ███████ ████ ██ ██ ██ ██ + ██ ██ ██ ██ ██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ + ██ ██ ██ ██ ██ ██ ███████ ███████ ███████ ██ ██ ██████ ██ ██ ██████ ██████ ██ ██ ███████ ██ ██████ ██████ diff --git a/src/index.js.amazee b/src/index.js.amazee new file mode 100644 index 0000000..9f26b97 --- /dev/null +++ b/src/index.js.amazee @@ -0,0 +1,20 @@ +const express = require('express') +const app = express() + +app.get('/', function (req, res) { + let result = [] + result.push(`
+   █████  ███    ███  █████  ███████ ███████ ███████    ██  ██████      ██████   ██████   ██████ ██   ██ ███████     ██    ██  ██████  ██    ██
+  ██   ██ ████  ████ ██   ██    ███  ██      ██         ██ ██    ██     ██   ██ ██    ██ ██      ██  ██  ██           ██  ██  ██    ██ ██    ██
+  ███████ ██ ████ ██ ███████   ███   █████   █████      ██ ██    ██     ██████  ██    ██ ██      █████   ███████       ████   ██    ██ ██    ██
+  ██   ██ ██  ██  ██ ██   ██  ███    ██      ██         ██ ██    ██     ██   ██ ██    ██ ██      ██  ██       ██        ██    ██    ██ ██    ██
+  ██   ██ ██      ██ ██   ██ ███████ ███████ ███████ ██ ██  ██████      ██   ██  ██████   ██████ ██   ██ ███████        ██     ██████   ██████
+

+ `) + res.header('X-LAGOON' , process.env.HOSTNAME ) + res.send(result.join("
")) +}) + +app.listen(3000, function () { + console.log('Example app listening on port 3000!') +}) diff --git a/src/index.js.mirantis b/src/index.js.mirantis new file mode 100644 index 0000000..b1fd656 --- /dev/null +++ b/src/index.js.mirantis @@ -0,0 +1,21 @@ +const express = require('express') +const app = express() + +app.get('/', function (req, res) { + let result = [] + result.push(`
+███    ███ ██ ██████   █████  ███    ██ ████████ ██ ███████     ██████   ██████   ██████ ██   ██ ███████     ██    ██  ██████  ██    ██
+████  ████ ██ ██   ██ ██   ██ ████   ██    ██    ██ ██          ██   ██ ██    ██ ██      ██  ██  ██           ██  ██  ██    ██ ██    ██
+██ ████ ██ ██ ██████  ███████ ██ ██  ██    ██    ██ ███████     ██████  ██    ██ ██      █████   ███████       ████   ██    ██ ██    ██
+██  ██  ██ ██ ██   ██ ██   ██ ██  ██ ██    ██    ██      ██     ██   ██ ██    ██ ██      ██  ██       ██        ██    ██    ██ ██    ██
+██      ██ ██ ██   ██ ██   ██ ██   ████    ██    ██ ███████     ██   ██  ██████   ██████ ██   ██ ███████        ██     ██████   ██████
+
+

+ `) + res.header('X-LAGOON' , process.env.HOSTNAME ) + res.send(result.join("
")) +}) + +app.listen(3000, function () { + console.log('Example app listening on port 3000!') +}) From 4ac7e57775774ec36ddd217d377514800d19604c Mon Sep 17 00:00:00 2001 From: Bryan Gruneberg Date: Mon, 27 Feb 2023 11:26:28 -0800 Subject: [PATCH 07/10] Make it a bit dynamic --- README.md | 7 +++++++ src/index.js | 20 ++++++++++++++++---- src/words.txt | 12 ++++++++++++ src/you_ops_we_aps.txt | 12 ++++++++++++ 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 README.md create mode 100644 src/words.txt create mode 100644 src/you_ops_we_aps.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..01d6b68 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Demo a node app + +## Use figlet to made a text logo +On ubuntu, `apt-get install figlet` + +Run `echo Some Words | figlet > src/words.txt` + diff --git a/src/index.js b/src/index.js index 9f26b97..9848ff2 100644 --- a/src/index.js +++ b/src/index.js @@ -1,16 +1,28 @@ const express = require('express') const app = express() +const fs = require('fs'); app.get('/', function (req, res) { - let result = [] - result.push(`
+
+  let words = "";
+  try {
+    words = fs.readFileSync('src/words.txt', 'utf8');
+    console.log(words);
+  } catch (err) {
+    console.error(err);
+    words = `
    █████  ███    ███  █████  ███████ ███████ ███████    ██  ██████      ██████   ██████   ██████ ██   ██ ███████     ██    ██  ██████  ██    ██
   ██   ██ ████  ████ ██   ██    ███  ██      ██         ██ ██    ██     ██   ██ ██    ██ ██      ██  ██  ██           ██  ██  ██    ██ ██    ██
   ███████ ██ ████ ██ ███████   ███   █████   █████      ██ ██    ██     ██████  ██    ██ ██      █████   ███████       ████   ██    ██ ██    ██
   ██   ██ ██  ██  ██ ██   ██  ███    ██      ██         ██ ██    ██     ██   ██ ██    ██ ██      ██  ██       ██        ██    ██    ██ ██    ██
   ██   ██ ██      ██ ██   ██ ███████ ███████ ███████ ██ ██  ██████      ██   ██  ██████   ██████ ██   ██ ███████        ██     ██████   ██████
-

- `) + `; + } + + let result = [] + result.push(`
`);
+  result.push(words);
+  result.push(`

`); res.header('X-LAGOON' , process.env.HOSTNAME ) res.send(result.join("
")) }) diff --git a/src/words.txt b/src/words.txt new file mode 100644 index 0000000..a02bb6c --- /dev/null +++ b/src/words.txt @@ -0,0 +1,12 @@ +__ __ _ _ _ +\ \ / /__ _ _ __| | ___ | |_| |__ ___ __ _ _ __ _ __ ___ + \ V / _ \| | | | / _` |/ _ \ | __| '_ \ / _ \ / _` | '_ \| '_ \/ __| + | | (_) | |_| | | (_| | (_) | | |_| | | | __/ | (_| | |_) | |_) \__ \_ + |_|\___/ \__,_| \__,_|\___/ \__|_| |_|\___| \__,_| .__/| .__/|___(_) + |_| |_| +__ __ _ _ _ +\ \ / /__ __| | ___ | |_| |__ ___ ___ _ __ ___ + \ \ /\ / / _ \ / _` |/ _ \ | __| '_ \ / _ \ / _ \| '_ \/ __| + \ V V / __/ | (_| | (_) | | |_| | | | __/ | (_) | |_) \__ \_ + \_/\_/ \___| \__,_|\___/ \__|_| |_|\___| \___/| .__/|___(_) + |_| diff --git a/src/you_ops_we_aps.txt b/src/you_ops_we_aps.txt new file mode 100644 index 0000000..a02bb6c --- /dev/null +++ b/src/you_ops_we_aps.txt @@ -0,0 +1,12 @@ +__ __ _ _ _ +\ \ / /__ _ _ __| | ___ | |_| |__ ___ __ _ _ __ _ __ ___ + \ V / _ \| | | | / _` |/ _ \ | __| '_ \ / _ \ / _` | '_ \| '_ \/ __| + | | (_) | |_| | | (_| | (_) | | |_| | | | __/ | (_| | |_) | |_) \__ \_ + |_|\___/ \__,_| \__,_|\___/ \__|_| |_|\___| \__,_| .__/| .__/|___(_) + |_| |_| +__ __ _ _ _ +\ \ / /__ __| | ___ | |_| |__ ___ ___ _ __ ___ + \ \ /\ / / _ \ / _` |/ _ \ | __| '_ \ / _ \ / _ \| '_ \/ __| + \ V V / __/ | (_| | (_) | | |_| | | | __/ | (_) | |_) \__ \_ + \_/\_/ \___| \__,_|\___/ \__|_| |_|\___| \___/| .__/|___(_) + |_| From 86d40aebf6b5bb6b7d8e70cfca448c491aadd034 Mon Sep 17 00:00:00 2001 From: Bryan Gruneberg Date: Mon, 27 Feb 2023 11:33:59 -0800 Subject: [PATCH 08/10] add project to lagoon --- .lagoon.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.lagoon.yml b/.lagoon.yml index c76c3c4..e95f9c9 100644 --- a/.lagoon.yml +++ b/.lagoon.yml @@ -1 +1,2 @@ docker-compose-yaml: docker-compose.yml +project: demo-node-simple From 588dc563e7fc95f9974dae215c71a7ee1683ce94 Mon Sep 17 00:00:00 2001 From: Bryan Gruneberg Date: Mon, 20 Nov 2023 14:38:41 -0600 Subject: [PATCH 09/10] Saying hello to ImageX --- src/words.txt | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/words.txt b/src/words.txt index a02bb6c..0878ca6 100644 --- a/src/words.txt +++ b/src/words.txt @@ -1,12 +1,6 @@ -__ __ _ _ _ -\ \ / /__ _ _ __| | ___ | |_| |__ ___ __ _ _ __ _ __ ___ - \ V / _ \| | | | / _` |/ _ \ | __| '_ \ / _ \ / _` | '_ \| '_ \/ __| - | | (_) | |_| | | (_| | (_) | | |_| | | | __/ | (_| | |_) | |_) \__ \_ - |_|\___/ \__,_| \__,_|\___/ \__|_| |_|\___| \__,_| .__/| .__/|___(_) - |_| |_| -__ __ _ _ _ -\ \ / /__ __| | ___ | |_| |__ ___ ___ _ __ ___ - \ \ /\ / / _ \ / _` |/ _ \ | __| '_ \ / _ \ / _ \| '_ \/ __| - \ V V / __/ | (_| | (_) | | |_| | | | __/ | (_) | |_) \__ \_ - \_/\_/ \___| \__,_|\___/ \__|_| |_|\___| \___/| .__/|___(_) - |_| + _ _ _ _ ____ ___ __ __ +| | | | ___| | | ___ / __ \ |_ _|_ __ ___ __ _ __ _ ___\ \/ / +| |_| |/ _ \ | |/ _ \ / / _` | | || '_ ` _ \ / _` |/ _` |/ _ \\ / +| _ | __/ | | (_) | | | (_| | | || | | | | | (_| | (_| | __// \ +|_| |_|\___|_|_|\___/ \ \__,_| |___|_| |_| |_|\__,_|\__, |\___/_/\_\ + \____/ |___/ From 8f18c92f3b6bffa5ff4101244063e3eaedf0b144 Mon Sep 17 00:00:00 2001 From: Bryan Gruneberg Date: Wed, 10 Apr 2024 20:00:30 -0600 Subject: [PATCH 10/10] SEB demo --- src/words.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/words.txt b/src/words.txt index 0878ca6..c6071cc 100644 --- a/src/words.txt +++ b/src/words.txt @@ -1,6 +1,6 @@ - _ _ _ _ ____ ___ __ __ -| | | | ___| | | ___ / __ \ |_ _|_ __ ___ __ _ __ _ ___\ \/ / -| |_| |/ _ \ | |/ _ \ / / _` | | || '_ ` _ \ / _` |/ _` |/ _ \\ / -| _ | __/ | | (_) | | | (_| | | || | | | | | (_| | (_| | __// \ -|_| |_|\___|_|_|\___/ \ \__,_| |___|_| |_| |_|\__,_|\__, |\___/_/\_\ - \____/ |___/ + ____ _____ ____ +/ ___| | ____| | __ ) +\___ \ | _| | _ \ + ___) || |___ _| |_) | +|____(_)_____(_)____/ +