-
Notifications
You must be signed in to change notification settings - Fork 1
/
transcribbr.js
43 lines (38 loc) · 918 Bytes
/
transcribbr.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Module dependencies.
*/
var express = require('express')
, stylus = require('stylus')
, http = require('http')
, nib = require('nib');
/**
* App.
*/
var app = express();// connect();// express();
var server = http.createServer(app);
/**
* App configuration.
*/
app.configure('development',function () {
app.use(stylus.middleware({ src: __dirname + '/public_html', compile: compile }));
app.use(express.static(__dirname + '/public_html'));
app.set('views', __dirname);
function compile (str, path) {
return stylus(str)
.set('filename', path)
.use(nib());
};
});
/**
* App routes.
*/
app.get('/', function (req, res) {
res.send('public_html/index.html', { 'Content-Type': 'text/html' }, 201);
});
/**
* App listen.
*/
server.listen(8080, function () {
var addr = server.address();
console.log(' app listening on http://' + addr.address + ':' + addr.port);
});