Removed deprecated Thingi and changed folder of views

This commit is contained in:
Tim Windelschmidt 2016-01-08 18:14:07 +01:00
parent 84e7689377
commit 9f174cb8e3
2 changed files with 4 additions and 5 deletions

View File

@ -1,4 +1,3 @@
exports.index = function (req, res) {
res.render('index', { title: 'Home' })
};

View File

@ -112,7 +112,7 @@ app.use(bodyParser.json({ extended: true }));
app.use(cookieSession({secret: 'steam-stalker', cookie: {maxAge: 60000}}));
app.use(flash());
app.set(__dirname + '/views');
app.set(path.resolve(__dirname + '/views'));
app.set('view engine', 'jade');
app.disable('x-powered-by');
app.enable('trust proxy');
@ -138,11 +138,11 @@ app.get('/api/usercount', function (req, res) {
});
app.get('/api/simple/image', function (req, res) {
if (spaceanswer.state.open == true) {
res.sendfile(path.resolve(__dirname, 'public/img/green.png'));
res.sendFile(path.resolve(__dirname, 'public/img/green.png'));
} else if (spaceanswer.state.open == false) {
res.sendfile(path.resolve(__dirname, 'public/img/red.png'));
res.sendFile(path.resolve(__dirname, 'public/img/red.png'));
} else {
res.sendfile(path.resolve(__dirname, 'public/img/yellow.png'));
res.sendFile(path.resolve(__dirname, 'public/img/yellow.png'));
}
});