loopback/lib/browser-express.js

37 lines
781 B
JavaScript
Raw Permalink Normal View History

2020-01-21 19:19:18 +00:00
// Copyright IBM Corp. 2014,2019. 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
'use strict';
const EventEmitter = require('events').EventEmitter;
const util = require('util');
2014-02-12 00:01:51 +00:00
module.exports = browserExpress;
function browserExpress() {
return new BrowserExpress();
2014-02-12 00:01:51 +00:00
}
browserExpress.errorHandler = {};
function BrowserExpress() {
this.settings = {};
}
util.inherits(BrowserExpress, EventEmitter);
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];
};