From 43ed7fb5708241771251ca07c3aed5629ee87fb0 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Tue, 13 Sep 2011 21:23:46 +0100 Subject: [PATCH] web interface test --- modules/views/index.jade | 4 ++++ modules/views/layout.jade | 6 ++++++ modules/web.js | 23 +++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 modules/views/index.jade create mode 100644 modules/views/layout.jade create mode 100644 modules/web.js diff --git a/modules/views/index.jade b/modules/views/index.jade new file mode 100644 index 0000000..7896851 --- /dev/null +++ b/modules/views/index.jade @@ -0,0 +1,4 @@ +div#main + div#title depressionbot web interface + p + | Bitch please diff --git a/modules/views/layout.jade b/modules/views/layout.jade new file mode 100644 index 0000000..293b43e --- /dev/null +++ b/modules/views/layout.jade @@ -0,0 +1,6 @@ +!!! 5 +html(lang: 'en') + head + meta(charset: 'utf-8') + title depressionbot web interface + body!= body diff --git a/modules/web.js b/modules/web.js new file mode 100644 index 0000000..dc71980 --- /dev/null +++ b/modules/web.js @@ -0,0 +1,23 @@ +var express = require('express'); +var app = express.createServer(); +var pub = '../public'; + +app.use(express.compiler({ src: pub, enable: ['sass'] })); +app.use(express.static(pub)); +app.set('view engine', 'jade'); + +var webInterface = function(dbot) { + var dbot = dbot; + + app.get('/', function(req, res) { + res.render('index', { }); + }); + + app.listen(1337); + + return { }; +}; + +exports.fetch = function(dbot) { + return webInterface(dbot); +};