diff --git a/Components/webserver.js b/Components/webserver.js index 46d1f29..7902cc0 100644 --- a/Components/webserver.js +++ b/Components/webserver.js @@ -3,6 +3,10 @@ const express = require('express'); const app = express(); const server = require('http').createServer(app); const port = process.env.PORT || 3430; +const test = require('../testdatabase.json'); + +var site; +// TODO: Add stuff for MySQL // Set the templates folder for the thingy app.set('views', __dirname + '/../Templates'); @@ -13,7 +17,17 @@ app.use(express.static(__dirname + '/../Public')); // Main page app.get('/', function(req, res){ - res.render('index'); + console.log('🌐 Client requested ' + req.url); + res.render('index', { test, site: 1 }); + console.log('✅ Client recieved ' + req.url); + // console.log(test.cars.Nissan[1].model) +}); + +app.get('/inventory', function(req, res){ + console.log('🌐 Client requested ' + req.url); + res.render('index', { test, site: 2 }); + console.log('✅ Client recieved ' + req.url); + // console.log(test.cars.Nissan[1].model) }); // Simple way to expose a function diff --git a/Public/MangoBerry.css b/Public/MangoBerry.css new file mode 100644 index 0000000..f72ac51 --- /dev/null +++ b/Public/MangoBerry.css @@ -0,0 +1,25 @@ +body { + margin: 0px; +} + + +.mbNavTop { + background-color: var(--colour-navbar); + overflow: hidden; + height: 65; + padding: 0 .5rem; + width:100vw; +} + +#Logo { + color:white; +} + +.mbNavTop a { + float:left; + color:antiquewhite; + text-align: center; + padding: 14px 16px; + text-decoration: none; + font-size: 17px; +} \ No newline at end of file diff --git a/Public/script.js b/Public/script.js new file mode 100644 index 0000000..d36cd2a --- /dev/null +++ b/Public/script.js @@ -0,0 +1 @@ +console.log('✅ Done') \ No newline at end of file diff --git a/Public/style.css b/Public/style.css index 1e3d829..81cc0fb 100644 --- a/Public/style.css +++ b/Public/style.css @@ -1,3 +1,3 @@ -#cssloaded { - color:deepskyblue; +:root { + --colour-navbar: #303030; } \ No newline at end of file diff --git a/Templates/index.ejs b/Templates/index.ejs index a1f3382..f64a434 100644 --- a/Templates/index.ejs +++ b/Templates/index.ejs @@ -11,7 +11,51 @@
-# | +Name | +Location | +Amount | +Tools | +
---|---|---|---|---|
<%= i + 1 %> | +<%= test.mangoshelf.Items[i].Name %> | +<%= test.mangoshelf.Items[i].Location %> | +<%= test.mangoshelf.Items[i].Amount %> | ++ |