pnxtech / hydra

A light-weight library for building distributed applications such as microservices
https://www.hydramicroservice.com
MIT License
645 stars 54 forks source link

Disable redis connection #207

Closed leonardorifeli closed 5 years ago

leonardorifeli commented 5 years ago

I'm using hydra to a single small gateway API. How to I disable redis connection? Do that's possible? Thanks.

emadum commented 5 years ago

You could use redis-mock.

leonardorifeli commented 5 years ago

Thanks, @emadum. But, to use redis-mock only, you can set testMode: true on properties file.

My properties file:

exports.value = {
    cluster: false,
    maxSockets: 500,
    environment: process.env.NODE_ENV || 'development',
    testMode: true, //here
    logPath: '',
    logRequestHeader: true,
    logOutboundRequest: true,
    hydra: {
        serviceName: 'api-name',
        serviceDescription: 'API',
        serviceIP: '',
        servicePort: 8000,
        serviceType: 'test',
        redis: {}
    }
};