Skip to content

Commit a855343

Browse files
committed
new example
1 parent 4e66b31 commit a855343

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
exports.install = function(framework) {
2+
framework.route('/', view_homepage);
3+
framework.route('/other/', view_other, ['get']);
4+
framework.route('/other/', view_other_post, ['post']);
5+
};
6+
7+
function view_homepage() {
8+
var self = this;
9+
if (!self.transfer('/other/', ['post']))
10+
return self.throw404();
11+
}
12+
13+
function view_other() {
14+
this.plain('OTHER - GET');
15+
}
16+
17+
function view_other_post() {
18+
this.plain('OTHER - POST');
19+
}

controller-transfer/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)