This commit is contained in:
Lucas Pleß 2013-10-08 22:13:20 +02:00
parent a65f090634
commit e28975b889
7 changed files with 67 additions and 31 deletions

3
node/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.idea/
*.iml
atlassian-ide-plugin.xml

View File

@ -1,25 +0,0 @@
client.on("error", function (err) {
console.log("Redis Error " + err);
});
client.on("connect", function () {
client.set("24:77:03:a9:f3:f4","lucas");
client.set("3c:97:0e:22:b7:68","lucas");
client.set("a0:0b:ba:c7:98:e5","lucas");
client.set("b8:27:eb:7d:6f:d2","rpi2");
client.set("b8:27:eb:7b:9b:9a","rpi3");
client.set("a8:88:08:10:a0:c5","pascal");
client.set("c8:97:9f:72:8f:67","fisch");
});

View File

@ -4,10 +4,11 @@
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"dependencies": { "dependencies": {
"express": "3.x", "express": "3.*",
"net-snmp": "x", "net-snmp": "*",
"redis": "x", "redis": "*",
"underscore": "x" "underscore": "*",
"jade": "*"
}, },
"main": "statusbot" "main": "index"
} }

6
node/public/style.css Normal file
View File

@ -0,0 +1,6 @@
body {
background: #ececec;
color: #343434;
}

View File

@ -72,7 +72,18 @@ function start() {
app.get('/api/simple/v2', function(req, res) { app.get('/api/simple/v2', function(req, res) {
res.send(simpleanswer); res.send(simpleanswer);
}); });
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.static(__dirname + '/public'))
app.get('/', function (req, res) {
res.render('index',
{ title : 'Home' }
)
});
app.disable('x-powered-by');
app.listen(3000); app.listen(3000);
snmpMac.poll(); snmpMac.poll();

24
node/views/index.jade Normal file
View File

@ -0,0 +1,24 @@
extend layout
block content
p
| Vivamus hendrerit arcu sed erat molestie
| vehicula. Sed auctor neque eu tellus
| rhoncus ut eleifend nibh porttitor. Ut in.
p
| Donec congue lacinia dui, a porttitor
| lectus condimentum laoreet. Nunc eu
| ullamcorper orci. Quisque eget odio ac
| lectus vestibulum faucibus eget in metus.
| In pellentesque faucibus vestibulum. Nulla
| at nulla justo, eget luctus tortor.
block sidebar
.widget
h1 Widget
p
| Sed auctor neque eu tellus rhoncus ut
| eleifend nibh porttitor. Ut in nulla enim.
p
| Vivamus hendrerit arcu sed erat molestie
| vehicula.

16
node/views/layout.jade Normal file
View File

@ -0,0 +1,16 @@
!!!5
html
head
title #{title} - My Site
link(rel='stylesheet', href='/style.css')
body
header
h1 My Site
.container
.main-content
block content
.sidebar
block sidebar
footer
hr
p Running on node with Express and Jade