diff options
Diffstat (limited to 'server/model/proxy.js')
-rw-r--r-- | server/model/proxy.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/server/model/proxy.js b/server/model/proxy.js new file mode 100644 index 0000000..ec78403 --- /dev/null +++ b/server/model/proxy.js @@ -0,0 +1,25 @@ +const { BeanModel } = require("redbean-node/dist/bean-model"); + +class Proxy extends BeanModel { + /** + * Return an object that ready to parse to JSON + * @returns {object} Object ready to parse + */ + toJSON() { + return { + id: this._id, + userId: this._user_id, + protocol: this._protocol, + host: this._host, + port: this._port, + auth: !!this._auth, + username: this._username, + password: this._password, + active: !!this._active, + default: !!this._default, + createdDate: this._created_date, + }; + } +} + +module.exports = Proxy; |