2018-01-03 04:05:53 +00:00
|
|
|
// Copyright IBM Corp. 2014,2018. All Rights Reserved.
|
2016-05-03 22:50:21 +00:00
|
|
|
// Node module: loopback
|
|
|
|
// This file is licensed under the MIT License.
|
|
|
|
// License text available at https://opensource.org/licenses/MIT
|
|
|
|
|
2016-11-15 21:46:23 +00:00
|
|
|
'use strict';
|
2019-10-07 09:45:34 +00:00
|
|
|
const EventEmitter = require('events').EventEmitter;
|
|
|
|
const util = require('util');
|
2014-07-25 00:00:27 +00:00
|
|
|
|
2014-02-12 00:01:51 +00:00
|
|
|
module.exports = browserExpress;
|
|
|
|
|
|
|
|
function browserExpress() {
|
2014-06-03 08:39:54 +00:00
|
|
|
return new BrowserExpress();
|
2014-02-12 00:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
browserExpress.errorHandler = {};
|
2014-06-03 08:39:54 +00:00
|
|
|
|
|
|
|
function BrowserExpress() {
|
|
|
|
this.settings = {};
|
|
|
|
}
|
|
|
|
|
2014-07-25 00:00:27 +00:00
|
|
|
util.inherits(BrowserExpress, EventEmitter);
|
|
|
|
|
2014-06-03 08:39:54 +00:00
|
|
|
BrowserExpress.prototype.set = function(key, value) {
|
|
|
|
if (arguments.length == 1) {
|
|
|
|
return this.get(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.settings[key] = value;
|
|
|
|
|
|
|
|
return this; // fluent API
|
|
|
|
};
|
|
|
|
|
|
|
|
BrowserExpress.prototype.get = function(key) {
|
|
|
|
return this.settings[key];
|
|
|
|
};
|