0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 23:40:35 -05:00
Squire/serve.js
Matthew Borden e0043013b1 Update: Editor & UI now load into selector.
Need to combat the problem of multiple instances.
2014-07-08 09:44:09 +10:00

15 lines
No EOL
453 B
JavaScript

var static = require('node-static');
var sys = require('sys');
var exec = require('child_process').exec;
var file = new static.Server('./');
function puts(error, stdout, stderr) { sys.puts(stdout) };
require('http').createServer(function (request, response) {
exec("make -f Makefile build", puts);
exec("make -f Makefile ui", puts);
request.addListener('end', function () {
file.serve(request, response);
}).resume();
}).listen(8080);