1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-17 01:17:29 +02:00

rename files

This commit is contained in:
sveisvei 2016-11-01 15:38:27 +01:00 committed by Ivar Conradi Østhus
parent 0a73ea0574
commit a4951d8dc8
5 changed files with 30 additions and 37 deletions

View File

@ -1,15 +1,13 @@
'use strict'; 'use strict';
const util = require('util'); class NameExistsError extends Error {
constructor (message) {
function NameExistsError (message) { super();
Error.call(this);
Error.captureStackTrace(this, this.constructor); Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name; this.name = this.constructor.name;
this.message = message; this.message = message;
}
} }
util.inherits(NameExistsError, Error);
module.exports = NameExistsError; module.exports = NameExistsError;

View File

@ -1,15 +1,13 @@
'use strict'; 'use strict';
const util = require('util'); class NotFoundError extends Error {
constructor (message) {
function NotFoundError (message) { super();
Error.call(this);
Error.captureStackTrace(this, this.constructor); Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name; this.name = this.constructor.name;
this.message = message; this.message = message;
}
} }
util.inherits(NotFoundError, Error);
module.exports = NotFoundError; module.exports = NotFoundError;

View File

@ -1,15 +1,13 @@
'use strict'; 'use strict';
const util = require('util'); class ValidationError extends Error {
constructor (message) {
function ValidationError (message) { super();
Error.call(this);
Error.captureStackTrace(this, this.constructor); Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name; this.name = this.constructor.name;
this.message = message; this.message = message;
}
} }
util.inherits(ValidationError, Error);
module.exports = ValidationError; module.exports = ValidationError;

View File

@ -1,16 +1,15 @@
'use strict'; 'use strict';
const util = require('util');
const EventEmitter = require('events').EventEmitter; const EventEmitter = require('events').EventEmitter;
function EventStore (eventDb) { module.exports = class EventStore extends EventEmitter {
constructor (eventDb) {
super();
this.eventDb = eventDb; this.eventDb = eventDb;
EventEmitter.call(this); }
}
util.inherits(EventStore, EventEmitter);
EventStore.prototype.create = function (event) { create (event) {
return this.eventDb.store(event).then(() => this.emit(event.type, event)); return this.eventDb.store(event).then(() => this.emit(event.type, event));
}
}; };
module.exports = EventStore;

View File

@ -4,7 +4,7 @@ const logger = require('./lib/logger');
const migrator = require('./migrator'); const migrator = require('./migrator');
const DEFAULT_OPTIONS = { const DEFAULT_OPTIONS = {
databaseUri: process.env.DATABASE_URL, databaseUri: process.env.DATABASE_URL || 'postgres://unleash_user:passord@localhost:5432/unleash',
port: process.env.HTTP_PORT || process.env.PORT || 4242, port: process.env.HTTP_PORT || process.env.PORT || 4242,
baseUriPath: process.env.BASE_URI_PATH || '', baseUriPath: process.env.BASE_URI_PATH || '',
}; };