Skip to content

Commit 840563d

Browse files
committed
updated examples according to a new version
1 parent 16c2048 commit 840563d

296 files changed

Lines changed: 1160 additions & 1700 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎angularjs-bootstrap/index.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
var framework = require('total.js');
2-
var http = require('http');
3-
var debug = true;
1+
// ===================================================
2+
// IMPORTANT: only for development
3+
// total.js - web application framework for node.js
4+
// http://www.totaljs.com
5+
// ===================================================
46

5-
framework.run(http, debug);
7+
require('total.js').http('debug');

‎angularjs-bootstrap/views/_layout.html‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
@{ng('angular', 'resource', 'route')}
32

43
<!DOCTYPE html>

‎angularjs-common/index.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
var framework = require('total.js');
2-
var http = require('http');
3-
var debug = true;
1+
// ===================================================
2+
// IMPORTANT: only for development
3+
// total.js - web application framework for node.js
4+
// http://www.totaljs.com
5+
// ===================================================
46

5-
framework.run(http, debug);
7+
require('total.js').http('debug');
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
var framework = require('total.js');
2-
var http = require('http');
3-
var debug = true;
1+
// ===================================================
2+
// IMPORTANT: only for development
3+
// total.js - web application framework for node.js
4+
// http://www.totaljs.com
5+
// ===================================================
46

5-
framework.run(http, debug);
7+
require('total.js').http('debug');

‎angularjs-routing/index.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
var framework = require('total.js');
2-
var http = require('http');
3-
var debug = true;
1+
// ===================================================
2+
// IMPORTANT: only for development
3+
// total.js - web application framework for node.js
4+
// http://www.totaljs.com
5+
// ===================================================
46

5-
framework.run(http, debug);
7+
require('total.js').http('debug');

‎angularjs-websocket/index.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
var framework = require('total.js');
2-
var http = require('http');
3-
var debug = true;
1+
// ===================================================
2+
// IMPORTANT: only for development
3+
// total.js - web application framework for node.js
4+
// http://www.totaljs.com
5+
// ===================================================
46

5-
framework.run(http, debug);
7+
require('total.js').http('debug');

‎angularjs/index.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
var framework = require('total.js');
2-
var http = require('http');
3-
var debug = true;
1+
// ===================================================
2+
// IMPORTANT: only for development
3+
// total.js - web application framework for node.js
4+
// http://www.totaljs.com
5+
// ===================================================
46

5-
framework.run(http, debug);
7+
require('total.js').http('debug');

‎assertion-testing/controllers/default.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
exports.install = function(framework) {
22
framework.route('/1/', test1);
33
framework.route('/2/', test2);
4-
framework.route('/3/', test3);
4+
framework.route('/3/', test3, ['post', 'json']);
55
};
66

77
exports.functions = {
@@ -24,5 +24,6 @@ function test2() {
2424

2525
function test3() {
2626
// throw error
27-
this.plain('4');
27+
var self = this;
28+
self.json(self.body);
2829
}

‎assertion-testing/test.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
var framework = require('total.js');
2-
var http = require('http');
1+
// ===================================================
2+
// IMPORTANT: only for testing
3+
// total.js - web application framework for node.js
4+
// http://www.totaljs.com
5+
// ===================================================
36

4-
framework.run(http, true, parseInt(process.argv[2]));
5-
framework.test();
7+
require('total.js').http('test');

‎assertion-testing/tests/default.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var assert = require('assert');
22

3-
exports.run = function(framework, name) {
3+
exports.run = function(framework) {
44

55
/**
66
* @see {@link http://docs.totaljs.com/Framework/#framework.assert|Documentation}
@@ -11,17 +11,17 @@ exports.run = function(framework, name) {
1111
next();
1212
});
1313

14-
framework.assert('Test URL 1', '/1/', ['GET'], function(error, data, code, headers, cookies, name) {
14+
framework.assert('Test URL 1', '/1/', ['get'], function(error, data, code, headers, cookies, name) {
1515
assert.ok(code === 200 && data === '1', name);
1616
});
1717

18-
framework.assert('Test URL 2', '/2/', ['GET'], function(error, data, code, headers, cookies, name) {
18+
framework.assert('Test URL 2', '/2/', ['get'], function(error, data, code, headers, cookies, name) {
1919
assert.ok(code === 200 && data === '2', name);
2020
});
2121

22-
framework.assert('Test URL 3', '/3/', ['GET'], function(error, data, code, headers, cookies, name) {
22+
framework.assert('Test URL 3', '/3/', ['post', 'json'], function(error, data, code, headers, cookies, name) {
2323
// throws error, data === 4
24-
assert.ok(code === 200 && data === '3', name);
25-
});
24+
assert.ok(code === 200 && JSON.parse(data).data === 3, name);
25+
}, { data: 4 });
2626

2727
};

0 commit comments

Comments
 (0)