#node SSR standalone adapter: schedule tasks within node-cron

14 messages · Page 1 of 1 (latest)

left sentinel
#

Hi,
I'm using node SSR adapter in production. I'd like to use node-cron module to schedule some tasks and initialize those tasks at server start. What's the best way to "hook" that code in production ? I got it working in dev mode using 'astro:server:start' hook, but can't seem to figure out a way in prod.

left sentinel
#

node SSR standalone adapter: schedule tasks within node-cron

outer lark
#

Following

#

Just out of curiosity why doesn't astro:server:start doesn't work in prod?

vapid estuary
#

Once the app Is built, hooks don't apply anymore

vapid estuary
outer lark
vapid estuary
#
  1. You always have to build an Astro project
  2. Hot reloading works only in dev, it doesn't work in production (after the build)
#

It seems to me that you're using the dev server in production. Don't do that 🙂

outer lark
#

Maybe we are misunderstanding each other: is it possible to have the same server entrypoint in both dev and production?