app.get('/_ah/stop', (req, res) => {
console.info('Shutting down.');
server.close();
res.send();
});
app.get('/_ah/start', (req, res) => {
res.send();
});
app.get('/health-check', (req, res) => {
res.send();
});
process.on('SIGTERM', () => {
console.info('SIGTERM signal received: closing HTTP server');
server.close(() => {
console.info('HTTP server closed');
});
});
Last active
October 7, 2022 10:41
-
-
Save ezequieltejada/150a3e1690b9517ec4c0dc6a1235595e to your computer and use it in GitHub Desktop.
App Engine gracefully handle shutdown
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment