Created
June 25, 2012 10:02
-
-
Save cheery/2987746 to your computer and use it in GitHub Desktop.
web app template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# position into www/index.coffee | |
getBuffer = (url, response) -> | |
xhr = new XMLHttpRequest() | |
xhr.open 'GET', url, true | |
xhr.responseType = 'arraybuffer' | |
xhr.onload = response | |
xhr.send() | |
$ -> | |
document.body.innerHTML = "<p>hello there!</p>" | |
getBuffer 'firmware', () -> | |
if this.status == 200 | |
window.firmware = new DataView(this.response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- position into www/index.html --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>web app template</title> | |
<script src="lib/jquery.min.js"></script><!-- wget http://code.jquery.com/jquery.min.js --> | |
<script src="index.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env coffee | |
express = require 'express' | |
spawn = require('child_process').spawn | |
compiler = spawn 'coffee', ['-cw', 'www'] | |
compiler.stdout.on 'data', (data) -> process.stdout.write('compiler: ' + data) | |
app = express.createServer() | |
app.use express.static('www') | |
app.listen(8000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment