Express-REST-API-Generator icon indicating copy to clipboard operation
Express-REST-API-Generator copied to clipboard

How to remove Redis and Mongo Dependencies

Open rjdjohnston opened this issue 5 years ago • 3 comments

Hello,

This is a great api boilerplate. My use case requires removing the queue/redis and mongo dependencies

From what I can tell, there is no way easy way to completely remove redis or mongo from the app.

Any help/guidance you can give would be greatly appreciated.

rjdjohnston avatar Aug 19 '19 19:08 rjdjohnston

Sorry for the late response.

If you still need this, you can comment out the dependencies in the database service file here services/database/index.js

The queue is also inactive by default until you start it via npm run workers

iolufemi avatar Apr 30 '20 02:04 iolufemi

var databases = {
    // logMongo: require('./logMongo'),
    // mongo: require('./mongo'),
    redis: require('./redis'),
    // api: require('./api'),
    sql: require('./sql')
};```

I tried but its not working still getting error 


`C:\work\n-power-chat-bot>gulp
[13:17:51] Using gulpfile C:\work\n-power-chat-bot\gulpfile.js
[13:17:51] Starting 'default'...
[13:17:51] [nodemon] 2.0.3
[13:17:51] [nodemon] to restart at any time, enter `rs`
[13:17:51] [nodemon] watching path(s): *.*
[13:17:51] [nodemon] watching extensions: js,mjs,json
[13:17:51] [nodemon] starting `node app.js`
C:\work\n-power-chat-bot\services\queue\Model.js:25
        type: db._mongoose.Schema.Types.Mixed
                 ^

TypeError: Cannot read property '_mongoose' of undefined
    at Object.<anonymous> (C:\work\n-power-chat-bot\services\queue\Model.js:25:18)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\work\n-power-chat-bot\services\queue\index.js:8:13)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\work\n-power-chat-bot\models\Organisations.js:4:13)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at C:\work\n-power-chat-bot\models\index.js:22:36
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (C:\work\n-power-chat-bot\models\index.js:18:7)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\work\n-power-chat-bot\routes\index.js:21:19)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\work\n-power-chat-bot\app.js:38:18)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47
[13:17:53] running tasks...`

razzul avatar Jun 06 '20 07:06 razzul

The queue and the request logs still depend on Mongo for the scheduler. Removing Mongo it'll break the scheduler. Leave the logMongo active.

iolufemi avatar Jun 10 '20 23:06 iolufemi