Skip to content

Commit 0d3ee40

Browse files
committed
new example
1 parent af72209 commit 0d3ee40

File tree

6 files changed

+40
-0
lines changed

6 files changed

+40
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
exports.install = function(framework) {
2+
framework.route('/', view_homepage);
3+
};
4+
5+
function view_homepage() {
6+
this.view('homepage');
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
// Merging files
3+
framework.merge('merge.js', '/js/a.js', '/js/b.js', 'http://www.totaljs.com/inject.js');

static-file-merge/index.js

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

static-file-merge/public/js/a.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var exports = {};
2+
3+
console.log('a');

static-file-merge/public/js/b.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('b');

static-file-merge/views/homepage.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@{layout('')}
2+
3+
<!DOCTYPE html>
4+
<html>
5+
<head>
6+
<title>Merging</title>
7+
<meta charset="utf-8" />
8+
<meta http-equiv="X-UA-Compatible" content="IE=10" />
9+
<meta name="format-detection" content="telephone=no"/>
10+
<meta name="viewport" content="width=1024, user-scalable=yes" />
11+
<meta name="robots" content="all,follow" />
12+
<script src="/merge.js"></script>
13+
</head>
14+
<body>
15+
16+
OPEN WEB DEVELOPER TOOLS -&gt; CONSOLE
17+
18+
</body>
19+
</html>

0 commit comments

Comments
 (0)