Skip to content

Commit d4748b0

Browse files
authored
Merge pull request #89 from CodelyTV/part_five_configuration
Part five configuration
2 parents 2fdbcd5 + 024e9c8 commit d4748b0

File tree

97 files changed

+288
-400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+288
-400
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
import convict from 'convict';
22

3-
const convictConfig = convict({
3+
const backofficeConfig = convict({
44
env: {
55
doc: 'The application environment.',
66
format: ['production', 'development', 'staging', 'test'],
77
default: 'default',
88
env: 'NODE_ENV'
99
},
10-
mongo: {
11-
url: {
12-
doc: 'The Mongo connection URL',
13-
format: String,
14-
env: 'MONGO_URL',
15-
default: 'mongodb://localhost:27017/backoffice-backend-dev'
16-
}
17-
},
1810
elastic: {
1911
url: {
2012
doc: 'The Elastic connection URL',
@@ -25,6 +17,6 @@ const convictConfig = convict({
2517
}
2618
});
2719

28-
convictConfig.loadFile([__dirname + '/default.json', __dirname + '/' + convictConfig.get('env') + '.json']);
20+
backofficeConfig.loadFile([__dirname + '/default.json', __dirname + '/' + backofficeConfig.get('env') + '.json']);
2921

30-
export default convictConfig;
22+
export default backofficeConfig;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"elastic": {
3+
"url": "http://elasticsearch:9200"
4+
}
5+
}

src/Contexts/Backoffice/Courses/infrastructure/persistence/BackofficeElasticConfigFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import config from '../../../../../apps/backoffice/backend/config/config';
1+
import config from '../config';
22
import ElasticConfig from '../../../../Shared/infrastructure/persistence/elasticsearch/ElasticConfig';
33

44
export class BackofficeElasticConfigFactory {

src/Contexts/Backoffice/Courses/infrastructure/persistence/BackofficeMongoConfigFactory.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/Contexts/Backoffice/Courses/infrastructure/persistence/MongoBackofficeCourseRepository.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/Contexts/Mooc/Courses/infrastructure/persistence/MongoCourseRepository.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export class MongoCourseRepository extends MongoRepository<Course> implements Co
1111

1212
public async search(id: CourseId): Promise<Nullable<Course>> {
1313
const collection = await this.collection();
14-
1514
const document = await collection.findOne({ _id: id.value });
1615

1716
return document ? Course.fromPrimitives({ ...document, id: id.value }) : null;

0 commit comments

Comments
 (0)