From fb0a492cbac8b744255704c3bd6140f4fb45e973 Mon Sep 17 00:00:00 2001 From: Yutsuo Date: Thu, 10 Jan 2019 21:36:46 +0000 Subject: [PATCH] Phase III Task 6 --- docker-compose.yml | 6 ++++-- nginx/html/index.html | 4 +++- nginx/html/test.html | 23 +++++++++++++++-------- node/app.js | 3 --- node/html/yay.html | 1 + 5 files changed, 23 insertions(+), 14 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f46f678..c447b0a 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,8 @@ version: '3' services: nginx: container_name: nginx - replicas: 3 + deploy: + replicas: 3 restart: always build: ./nginx image: custom/nginx @@ -16,7 +17,8 @@ services: - network_1 app: container_name: app - replicas: 5 + deploy: + replicas: 6 build: ./node image: custom/node volumes: diff --git a/nginx/html/index.html b/nginx/html/index.html index 6733613..357ef2f 100644 --- a/nginx/html/index.html +++ b/nginx/html/index.html @@ -1,3 +1,4 @@ +
@@ -19,4 +20,5 @@
- \ No newline at end of file + + \ No newline at end of file diff --git a/nginx/html/test.html b/nginx/html/test.html index 1b1b76c..972d6c9 100644 --- a/nginx/html/test.html +++ b/nginx/html/test.html @@ -1,22 +1,22 @@ - @@ -26,5 +26,12 @@

HTML calling REST API

+
+ +

+
\ No newline at end of file diff --git a/node/app.js b/node/app.js index 2e2b847..5952946 100755 --- a/node/app.js +++ b/node/app.js @@ -230,7 +230,6 @@ restrictedRoutes.all('/', function(req, res, next) { }) restrictedRoutes.use(function (req, res, next) { - // let hostname = os.hostname() res.setHeader('HOSTNAME', os.hostname()) if (req.cookies.token) { jwt.verify(req.cookies.token, secret, function (err, decoded) { @@ -259,9 +258,7 @@ restrictedRoutes.use(function (req, res, next) { // Restricted endpoint restrictedRoutes.get('/', (req, res) => { - // let successMsg = JSON.stringify({secret:'You have access to restricted contents!'}) res.status(200).json([{secret:'You have access to restricted contents!'}]) - // res.status(200).send(successMsg) console.log(JSON.stringify({secret:'You have access to restricted contents!'})) }) diff --git a/node/html/yay.html b/node/html/yay.html index 8aca960..f8f450d 100644 --- a/node/html/yay.html +++ b/node/html/yay.html @@ -11,6 +11,7 @@ console.log('why, though'); console.log(Object.values(data)); console.log(Object.keys(data)); + console.log(res.headers) }) })