Skip to content

Commit

Permalink
Upgrade dependencies + Fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienXtraLife committed Oct 18, 2024
1 parent ea28147 commit a6862b5
Show file tree
Hide file tree
Showing 5 changed files with 322 additions and 323 deletions.
18 changes: 9 additions & 9 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,20 @@ module.exports = (configuration = {
},

mongoCx(cb) {
return require("mongodb").MongoClient.connect(xlenv.mongodb.url, xlenv.mongodb.options).then(client => {
cb(null, client);
}).catch(error => {
cb(error);
});
const { MongoClient } = require('mongodb');
const client = new MongoClient(xlenv.mongodb.url, xlenv.mongodb.options);
return client.connect()
.then(() => cb(null, client))
.catch(err => cb(err));
},

elastic: {
elasticConfig: {
driver: {
version: "8.7.0",
version: "8.8.0",
}
},
elasticClient(cb) {

elastic(cb) {
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200' ,
Expand Down
12 changes: 3 additions & 9 deletions config/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,16 @@ module.exports = {

redis: {
config: { // refer to https://github.com/luin/ioredis/blob/v4/API.md#new-redisport-host-options
port: 6378,
port: 6379,
host: 'localhost'
}
},

mongodb: {
url: "mongodb://localhost:27018/?maxPoolSize=5"
url: "mongodb://localhost:27017/?maxPoolSize=5"
},

elastic: {
driver: {
version: "8.7.0",
}
},

elasticClient(cb) {
elastic(cb) {
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: 'http://localhost:9200' ,
Expand Down
8 changes: 1 addition & 7 deletions config/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ module.exports = {
url: `mongodb://${process.env.MONGODB_PORT_27017_TCP_ADDR}:${process.env.MONGODB_PORT_27017_TCP_PORT}/?maxPoolSize=25`
},

elastic: {
driver: {
version: "8.7.0",
}
},

elasticClient(cb) {
elastic(cb) {
const { Client } = require('@elastic/elasticsearch')
const client = new Client({
node: `https://${process.env.ELASTIC_PORT_9200_TCP_ADDR}:${process.env.ELASTIC_PORT_9200_TCP_PORT}` ,
Expand Down
Loading

0 comments on commit a6862b5

Please sign in to comment.