Skip to content

Commit 6192cb5

Browse files
author
James Halliday
committed
browser example
1 parent 0557b39 commit 6192cb5

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

example/static/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
browserify ../timing.js -o bundle.js

example/static/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<style>
5+
body {
6+
font-family: monospace;
7+
white-space: pre;
8+
}
9+
</style>
10+
</head>
11+
<body>
12+
<script>
13+
if (typeof console === 'undefined') console = {};
14+
console.log = function (msg) {
15+
var txt = document.createTextNode(msg);
16+
document.body.appendChild(txt);
17+
};
18+
</script>
19+
<script src="bundle.js"></script>
20+
</body>
21+
</html>

example/static/server.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
var http = require('http');
2+
var ecstatic = require('ecstatic')(__dirname);
3+
var server = http.createServer(ecstatic);
4+
server.listen(8000);

0 commit comments

Comments
 (0)