Replies: 2 comments 7 replies
-
What kind of payload would you expect from this hook? I would also argue that passing a function like this isn't a safe approach, because this is information that must be available after a build, and a function can't because it's not serialisable. Usually, we accept a path to an entry point, load it, and execute it. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Isn’t this already possible with a simple server script something like: // ./run-server.mjs
console.log("This will be executed before the server is started");
await import("./dist/server/entry.mjs"); node ./run-server.mjs |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Summary
Not sure if this is "big enough" for its own RFC. But this is where GitHub directed me. It might just be a minor PR.
It would be very helpful, if the
@astrojs/node
would allow to pass a function as astart
parameter, which would then be executed when the server is started.Specifying a
start
hook is already a feature of the Adapter API – it would only be necessary to forwardstart
via the Adapter configuration.Background & Motivation
This would be useful to setup the proper server environment before the Astro application is started. E.g. setting up a cron job.
Goals
A concise, bulleted-list outlining the intended goals of this RFC.
Example
Beta Was this translation helpful? Give feedback.
All reactions