Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@r03ert0
Created October 18, 2017 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r03ert0/e25d558d873453df66b521e85f0fced6 to your computer and use it in GitHub Desktop.
Save r03ert0/e25d558d873453df66b521e85f0fced6 to your computer and use it in GitHub Desktop.
app.post('/api/stop', tokenAuthentication, (req, res) => {
console.log('hello', req.body);
if( req.isTokenAuthenticated ) {
console.log("Stopped by", req.tokenUsername);
process.exit();
} else {
console.log("Token required");
}
res.send();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment