From 707b1e5bce160728bd3600c7cacc9a5d10c12950 Mon Sep 17 00:00:00 2001
From: Athanasios <ath.kouk.oid@gmail.com>
Date: Tue, 27 Jul 2021 14:52:46 +0200
Subject: [PATCH] inject repository url

Inject the repository url in the home page.
---
 config.js      | 3 +++
 routes/home.js | 7 ++++++-
 views/home.pug | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/config.js b/config.js
index fedfc48..55233ad 100644
--- a/config.js
+++ b/config.js
@@ -3,6 +3,9 @@ const config = {
   storage: {
     type: "JSON",
     path: "./assets/assets.json"
+  },
+  repository:{
+    url: "https://gitlab.com/tomeof/node-3dps"
   }
 }
 
diff --git a/routes/home.js b/routes/home.js
index fe8a6c2..4672b36 100644
--- a/routes/home.js
+++ b/routes/home.js
@@ -1,5 +1,7 @@
 const express = require("express");
 const pug = require("pug");
+const config = require("../config");
+
 
 let router = express.Router();
 
@@ -18,7 +20,10 @@ router.route("/")
 `;
 
     const compiledFunction = pug.compileFile("./views/home.pug");
-    let home = compiledFunction({art: art});
+    let home = compiledFunction({
+      art: art,
+      url: config.repository.url
+    });
     res.set("Content-Type", "text/html");
     res.send(home);
     
diff --git a/views/home.pug b/views/home.pug
index bfdb8b3..e2b627e 100644
--- a/views/home.pug
+++ b/views/home.pug
@@ -16,4 +16,4 @@ html(lang="en")
     div(class="centered")
       pre= art
       p This is an impementation of the 3D Portrayal Service.
-      p For more details visit #[a( href="https://gitlab.com/tomeof/node-3dps", target="_blank" ) https://gitlab.com/tomeof/node-3dps]
+      p For more details visit #[a( href=`${url}`, target="_blank" ) !{url}]
\ No newline at end of file
-- 
GitLab