code: function listen(appDirectory, sessionStore, preSessionInject, postSessionInject, sendToLogFunction) {
  
      let builder = new ConfigBuilder(new ConfigApi());
      let configStore = builder.build(appDirectory);
      let amorphicOptions = AmorphicContext.amorphicOptions;
  
      if (typeof sendToLogFunction === 'function') {
          AmorphicContext.appContext.sendToLog = sendToLogFunction;
          SupertypeSession.logger.setLogger(sendToLogFunction);
      }
  
      buildStartUpParams(configStore);
  
      let sanitizedAmorphicOptions = Object.assign({}, amorphicOptions);
      delete sanitizedAmorphicOptions.sessionSecret;
  
      logMessage('Starting Amorphic with options: ' + JSON.stringify(sanitizedAmorphicOptions));
  
      let sessionConfig = {
          secret: amorphicOptions.sessionSecret,
          cookie: {
              maxAge: amorphicOptions.sessionExpiration
          },
          resave: false,
          saveUninitialized: true,
          rolling: true
      };
  
      if (sessionStore) {
          sessionConfig['store'] = sessionStore;
      }
      // Initialize applications
      let appList = amorphicOptions.appList;
      let appStartList = amorphicOptions.appStartList;
      let promises = [];
  
      for (let appKey in appList) {
          if (appStartList.indexOf(appKey) >= 0) {
              promises.push(startApplication(appKey, appDirectory, appList, configStore, sessionStore));
          }
      }
  
      return Bluebird.all(promises)
          .then(createServer.bind(this, preSessionInject, postSessionInject, appList, appStartList, appDirectory, sessionConfig))
          .then(function logStart() {
              logMessage('Amorphic has been started');
          })
          .catch(function error(e) {
              logMessage(e.message + ' ' + e.stack);
          });
  }
docs: asynchronous listener function (returns a promise)
  
  @param {unknown} appDirectory unknown
  @param {unknown} sessionStore unknown
  @param {unknown} preSessionInject unknown
  @param {unknown} postSessionInject unknown
  @param {unknown} sendToLogFunction unknown