app.js
/**
 * http_settings
 * 
 * Returns the current settings in the database
 */


Returns the current settings in the database
Returns the current settings in the database
function http_settings(request) {
  return new Promise((resolve, reject) => {
    DB.all("SELECT key, value FROM settings", (err, rows) => {
      if (err) return reject(err);
      var settings = {};
      for (var i in rows) {
        settings[rows[i].key] = rows[i].value;
      }
      resolve({settings: settings});
    });
  });
}
function http_settings ( request ) { return new Promise ( ( resolve , reject ) => { DB . all ( "SELECT key, value FROM settings" , ( err , rows ) => { if ( err ) return reject ( err ) ; var settings = { } ; for ( var i in rows ) { settings [ rows [ i ] . key ] = rows [ i ] . value ; } resolve ( { settings : settings } ) ; } ) ; } ) ; }
http_settings
http_settings