import hapi from '@hapi/hapi'
import hapiTwilioAuth from 'hapi-twilio-auth'
const { Server } = hapi
async function startServer() {
const server = new Server({
port: 3000,
})
await server.register(hapiTwilioAuth)
server.auth.strategy('twilio-auth', 'twilio-signature', {
baseUrl: 'https://mycompany.com/webhooks-path',
twilioAuthToken: 'xxxxxxxxxxx',
})
server.route({
method: 'POST',
path: '/',
handler(request, h) {
},
})
await server.start()
}
startServer()