message: starting to integrate indexers into main server process
diff: @@ -2,13 +2,21 @@ const Koa = require('koa');
  const Searcher = require('@cardstack/elasticsearch/searcher');
  const Writers = require('@cardstack/server/writers');
  const SchemaCache = require('@cardstack/server/schema-cache');
  +const Indexers = require('@cardstack/server/indexers');
  const logger = require('heimdalljs-logger');
  const log = logger('server');
  const commander = require('commander');
  const path = require('path');
  -function runServer(port, seedModels) {
  +async function runServer(port, seedModels) {
  let schemaCache = new SchemaCache(seedModels);
  +
  + // TODO
  + // - add notification from writer
  + // - add periodic update
  + let indexers = new Indexers(schemaCache);
  + await indexers.update();
  +
  let app = new Koa();
  app.use(require('@cardstack/jsonapi/middleware')(new Searcher(schemaCache), new Writers(schemaCache)));
  app.listen(port);
  @@ -40,6 +48,12 @@ function loadSeedModels(options) {
  }
  }
  +// Without this, we can't see stack traces for certain failures within
  +// promises during the test suite.
  +process.on('warning', (warning) => {
  + process.stderr.write(warning.stack);
  +});
  +
  let options = commandLineOptions();
  let seedModels = loadSeedModels(options);
  runServer(options.port, seedModels);
  