@ukoloff/fgh
Version:
Browser-based client for fossil, git and hg SCMs
34 lines • 843 B
JavaScript
// Generated by LiveScript 1.6.0
var path, http, express, opener, ws, args, app, server;
path = require('path');
http = require('http');
express = require('express');
opener = require('opener');
ws = require('./ws');
args = require('./args');
if (args.args.length) {
process.chdir(args.args[0]);
}
app = express();
ws(server = http.createServer(app));
app.use(
express['static'](
path.join(__dirname, '../client')));
app.use(
express['static'](
path.join(require.resolve('bootswatch/package'), '../dist')));
app.use(
express['static'](
path.dirname(
require.resolve('font-awesome/package'))));
server.listen(args.port || 0, 'localhost', function(){
var port, url;
port = this.address().port;
url = "http://localhost:" + port;
if (args.prompt) {
console.log("Connect to " + url);
}
if (args.browser) {
opener(url);
}
});