Skip to content

Instantly share code, notes, and snippets.

@petersirka
Last active July 3, 2016 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petersirka/3604e5b2e8b521056aaeb7c214ad4c99 to your computer and use it in GitHub Desktop.
Save petersirka/3604e5b2e8b521056aaeb7c214ad4c99 to your computer and use it in GitHub Desktop.
How to run Total.js without installation?
function main() {
F.route('/', function() {
this.plain('HOMEPAGE');
});
// debug (development mode), release (production mode), test (testing mode)
F.http('debug');
}
require('http').get('http://modules.totaljs.com/latest/total.js', function(res) {
var buffer = new Buffer(0);
res.on('data', (b) => buffer = Buffer.concat([buffer, b]));
res.on('end', () => main(eval(buffer.toString('utf8'))));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment