#Whats the best way to run a startup process when nuxt starts? Like setting some redis cache on start

3 messages · Page 1 of 1 (latest)

peak belfry
#

Would this be a good spot to do it:

export default defineNuxtConfig({
  hooks: {
    ready: () => {
      console.log("startup");
    },
  },
});
spring valley
peak belfry
#

Oh interesting, thank you, I will take a look

What if I want to register a database connection handler, like a Prisma db object and make it a plugin provider helper, like $prisma. So it's easily accessed in my view components, but also how would access it in a nitro plugin?