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 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/docker-compose.yml b/docker-compose.yml index 48a7c45..e635031 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,13 +7,14 @@ services: build: context: . dockerfile: node.dockerfile + command: yarn run dev labels: lagoon.type: node volumes: - - .:/app:delegated + - ./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: 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..2bfca52 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,10 @@ "express": "^4.17.1" }, "scripts": { - "start": "node index.js" + "start": "node src/index.js", + "dev": "nodemon src/index.js" + }, + "devDependencies": { + "nodemon": "^2.0.20" } } 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 b/src/index.js new file mode 100644 index 0000000..9848ff2 --- /dev/null +++ b/src/index.js @@ -0,0 +1,32 @@ +const express = require('express') +const app = express() +const fs = require('fs'); + +app.get('/', function (req, res) { + + 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("
")) +}) + +app.listen(3000, function () { + console.log('Example app listening on port 3000!') +}) 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!') +}) 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 @@ +███ ███ ██ ██████ █████ ███ ██ ████████ ██ ███████ ██████ ██████ ██████ ██ ██ ███████ ██ ██ ██████ ██ ██ +████ ████ ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +██ ████ ██ ██ ██████ ███████ ██ ██ ██ ██ ██ ███████ ██████ ██ ██ ██ █████ ███████ ████ ██ ██ ██ ██ +██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ +██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ███████ ██ ██ ██████ ██████ ██ ██ ███████ ██ ██████ ██████ + diff --git a/src/words.txt b/src/words.txt new file mode 100644 index 0000000..c6071cc --- /dev/null +++ b/src/words.txt @@ -0,0 +1,6 @@ + ____ _____ ____ +/ ___| | ____| | __ ) +\___ \ | _| | _ \ + ___) || |___ _| |_) | +|____(_)_____(_)____/ + 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 / __/ | (_| | (_) | | |_| | | | __/ | (_) | |_) \__ \_ + \_/\_/ \___| \__,_|\___/ \__|_| |_|\___| \___/| .__/|___(_) + |_|