docs: async function startApp(config = {}) {
    const {
      databaseURL = DEFAULT_MONGO,
      port = DEFAULT_PORT,
      host = DEFAULT_HOST,
      autoConnect = true
    } = config; // close all connections when running nodemon
  
    process.once('SIGUSR2', async () => {
      await app.destroy();
      process.kill(process.pid, 'SIGUSR2');
    });
    const db = new _database.default();
    const appMeta = await (0, _createApp.default)(config, db);
    const {
      app
    } = appMeta;
    const server = await listen(app, port, host);
    (0, _serverDestroy.default)(server);
  
    app.destroy = async () => {
      await Promise.all([disconnectFromDatabase(db), destroy(server)]);
    };
  
    const {
      port: serverPort
    } = server.address();
    const url = `http://localhost:${serverPort}`;
    const router = (0, _koaRouter.default)();
  
    const connect = async () => {
      await db.connect(databaseURL);
    };
  
    if (autoConnect) {
      await connect();
    }
  
    return { ...appMeta,
      router,
      url,
      ...(autoConnect ? {} : {
        connect
      })
    };
  }