Skip to content

Commit 3bd47e8

Browse files
committed
added: framework-functions
1 parent b22095c commit 3bd47e8

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
exports.install = function(framework) {
2+
framework.route('/', plain_homepage);
3+
};
4+
5+
function plain_homepage() {
6+
var self = this;
7+
8+
var now = framework.functions.now();
9+
var hello = framework.functions.hello();
10+
11+
self.plain(now.format('dd.MM.yyyy - HH:mm:ss') + ' - ' + hello);
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
framework.functions.now = function() {
3+
return new Date();
4+
};
5+
6+
framework.functions.hello = function() {
7+
return 'Hello world!';
8+
};

framework-functions/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var framework = require('total.js');
2+
var http = require('http');
3+
var debug = true;
4+
5+
framework.run(http, debug);

0 commit comments

Comments
 (0)