Expose HTTP shutdown API
Summary: Expose the shutdown API via the HTTP server. Reviewed By: ivanmisuno Differential Revision: D49496840 fbshipit-source-id: df2045edc89e9feabe74b4b513f973d137323d0f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1db90f9187
commit
6df27824b7
@@ -133,6 +133,14 @@ async function startHTTPServer(config: Config): Promise<{
|
||||
res.end(JSON.stringify({isReady}));
|
||||
});
|
||||
|
||||
app.get('/shutdown', (_req, res) => {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.end(JSON.stringify({success: true}));
|
||||
|
||||
// Just exit the process, this will trigger the shutdown hooks.
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
app.get('/health', (_req, res) => {
|
||||
res.end('flipper-ok');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user