Strapi Hooks - Use cases

Hello all ,

i am unable to run my custom server hook,can someone please help.

i have my config file in ./config/hook.js

module.exports = ({ env }) => ({
  settings: {
   redis: {
      enabled: true,
      db: 0,
      host: env("REDIS_HOST"),
      port: env.int("REDIS_PORT"),
    },
  },
});

i have my hook in ./hooks/redis/index.js

const Redis = require("ioredis");
module.exports = (strapi) => {
  return {
    async initialize() {
      console.log(" hello it should work");    
    },
  };
};

it works in v3 but in v4 it does not work

2 Likes