1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00

rename files

This commit is contained in:
sveisvei 2016-11-01 15:38:27 +01:00
parent ee95e8e960
commit 9b825ccaf0
5 changed files with 30 additions and 37 deletions

View File

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

View File

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

View File

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

View File

@ -1,16 +1,15 @@
'use strict';
const util = require('util');
const EventEmitter = require('events').EventEmitter;
function EventStore (eventDb) {
this.eventDb = eventDb;
EventEmitter.call(this);
}
util.inherits(EventStore, EventEmitter);
module.exports = class EventStore extends EventEmitter {
constructor (eventDb) {
super();
this.eventDb = eventDb;
}
EventStore.prototype.create = function (event) {
return this.eventDb.store(event).then(() => this.emit(event.type, event));
create (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 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,
baseUriPath: process.env.BASE_URI_PATH || '',
};