Need a callback on start of standalone server #58819
rajatdhoot123
started this conversation in
Ideas
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goal
Deploy a Next.js standalone app with zero downtime by running a specific command (
process.send
) when the server starts.Background
There is a need for a server start callback to facilitate various purposes, including deploying with pm2 without downtime.
Proposal
Add a callback in the
finally
block of the server start process to execute the desired command. Modify the existing code as follows:This modification ensures that the specified command (
nextConfig.onServerCallback()
) is executed after the server starts, addressing the need for a server start callback.Beta Was this translation helpful? Give feedback.
All reactions