See the Travis CI docs on Verifying Webhook requests for more information.
Node.js Webhook Verification Examples
The hapi example code can be found here.
The express example code can be found here.
Read more about these examples in my blog post, Verify Travis CI Webhook Notifications with Node.js