aboutsummaryrefslogtreecommitdiff
path: root/mi-gateway
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-10 14:06:18 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-10 14:06:18 +0200
commitbc18049649f0d9cf5efc5a8edc425de2c8707267 (patch)
tree41becfbb32bff2faa4658af928186abb2a05d302 /mi-gateway
downloadk8s-sandbox-bc18049649f0d9cf5efc5a8edc425de2c8707267.tar.gz
k8s-sandbox-bc18049649f0d9cf5efc5a8edc425de2c8707267.tar.bz2
k8s-sandbox-bc18049649f0d9cf5efc5a8edc425de2c8707267.tar.xz
k8s-sandbox-bc18049649f0d9cf5efc5a8edc425de2c8707267.zip
wip
Diffstat (limited to 'mi-gateway')
-rw-r--r--mi-gateway/Dockerfile14
-rw-r--r--mi-gateway/package.json11
-rw-r--r--mi-gateway/server.js31
3 files changed, 56 insertions, 0 deletions
diff --git a/mi-gateway/Dockerfile b/mi-gateway/Dockerfile
new file mode 100644
index 0000000..d657cc3
--- /dev/null
+++ b/mi-gateway/Dockerfile
@@ -0,0 +1,14 @@
+FROM node:8
+
+WORKDIR /opt
+
+COPY package*.json ./
+
+RUN npm install
+# If you are building your code for production
+# RUN npm ci --only=production
+
+COPY . .
+
+EXPOSE 8080
+CMD [ "npm", "start" ]
diff --git a/mi-gateway/package.json b/mi-gateway/package.json
new file mode 100644
index 0000000..2deee39
--- /dev/null
+++ b/mi-gateway/package.json
@@ -0,0 +1,11 @@
+{
+ "name": "mi-gateway",
+ "version": "1.0.0",
+ "main": "server.js",
+ "scripts": {
+ "start": "node server.js"
+ },
+ "dependencies": {
+ "express": "^4.16.1"
+ }
+}
diff --git a/mi-gateway/server.js b/mi-gateway/server.js
new file mode 100644
index 0000000..4d2546f
--- /dev/null
+++ b/mi-gateway/server.js
@@ -0,0 +1,31 @@
+'use strict';
+
+const express = require('express');
+
+const PORT = 8080;
+const HOST = '0.0.0.0';
+
+const app = express();
+app.get('/', (req, res) => {
+ res.send('mi-gateway 2\n');
+});
+
+app.listen(PORT, HOST);
+console.log(`Running on http://${HOST}:${PORT}`);
+
+var keys = [];
+for(var key in process.env) {
+ if (key.startsWith("npm")) {
+ continue;
+ }
+
+ keys[keys.length] = key;
+}
+keys.sort()
+
+console.log("ENV");
+for (var idx in keys) {
+ const key = keys[idx];
+ const value = process.env[key];
+ console.log(" " + key + "=" + value);
+}