<commit_before>import abe.App;
import mw.ConnectLivereload;
import js.node.Path;
import express.*;
import routes.*;

class Main {
  public static function main() {
    var app = new App(),
        api = app.sub("/api"),
        stat = app.sub("/");

    api.router.register(new Cards());

    stat.router.use(ConnectLivereload.create());
    stat.router.use(function (req : Request, res : Response, next : Next) {
      if (Path.extname(req.path).length > 0) {
        // if they requested a resource with a file extension, just send it
        next.call();
      } else {
        // otherwise, always return the same mithril app for routing purposes
        res.sendFile('index.html', { root : './public' });
      }
    });
    stat.router.serve('/', './public');

    // server all subrouters on 3333
    app.http(3333);
  }
}<commit_msg>Configurable port<commit_after>import abe.App;
import mw.ConnectLivereload;
import js.node.Path;
import express.*;
import routes.*;

class Main {
  public static function main() {
    var app = new App(),
        api = app.sub("/api"),
        stat = app.sub("/"),
        port = 3333;

    if (js.Node.process.argv[2] != null) {
      port = Std.parseInt(js.Node.process.argv[2]);
    }

    api.router.register(new Cards());

    stat.router.use(ConnectLivereload.create());
    stat.router.use(function (req : Request, res : Response, next : Next) {
      if (Path.extname(req.path).length > 0) {
        // if they requested a resource with a file extension, just send it
        next.call();
      } else {
        // otherwise, return the same app and let the client handle routing
        res.sendFile('index.html', { root : './public' });
      }
    });
    stat.router.serve('/', './public');
    app.http(port, function () {
      trace('Listening on port $port');
    });
  }
}
{'fraction_non_alphanumeric': 0.15628415300546447, 'fraction_numerical': 0.008743169398907104, 'mean_word_length': 2.4942748091603053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4960436', 'n_tokens_mistral': 580, 'n_tokens_neox': 550, 'n_words': 153}