{"size": 877, "ext": "js", "max_stars_repo_path": "site/lib/server.js", "max_stars_repo_name": "moonwave99/playa", "max_stars_repo_stars_event_min_datetime": "2015-07-31T19:14:33.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-26T14:47:08.000Z", "max_issues_repo_path": "site/lib/server.js", "max_issues_repo_name": "moonwave99/playa", "max_issues_repo_issues_event_min_datetime": "2015-07-31T23:51:33.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-25T19:02:45.000Z", "max_forks_repo_path": "site/lib/server.js", "max_forks_repo_name": "moonwave99/playa", "max_forks_repo_forks_event_min_datetime": "2015-08-01T15:42:12.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-17T02:09:18.000Z"}
{"max_stars_count": 95, "max_issues_count": 55, "max_forks_count": 14, "avg_line_length": 20.880952381, "max_line_length": 67, "alphanum_fraction": 0.5735461802}
const Waffel = require('waffel');
const renderer = require('./renderer');
const filters = require('./filters');
const helpers = require('./helpers');
const git = require('./git');
const appInfo = require('./appInfo');

module.exports.startServer = async function(port, path, callback) {
  const domain = process.env.DOMAIN || 'localhost';
  const wfl = new Waffel({
    domain: `http://${domain}:${port}`,
    uglyUrls: true,
    versionAssets: true,
    markdownOptions: {
      renderer: renderer()
    },
    prettyHTML: {
      enable: true,
      options: {
        ocd: false
      }
    },
    filters,
    helpers,
    watch: true,
    server: true,
    serverConfig: {
      port,
      path,
      indexPath: `${path}/404.html`
    }
  });
  wfl.on('server:start', callback);
  await wfl.init()
  wfl.generate({
    data: {
      git,
      ...appInfo
    }
  });
};
