1.0.3 • Published 7 years ago
fastify-zalo v1.0.3
fastify-zalo
Zalo SDK wrapper for Fastify
To view the complete documentation, please visit the Zalo SDK documentation.
Install
npm i -S fastify-zalo
Usage
const fastify = require('fastify')()
const Zalo = require('fastify-zalo')
fastify.register(
Zalo,
// Register the configuration you want to use
{
// Using for Social APIs
social: {
appId: 'your app id',
redirectUri: 'your callback url',
appSecret: 'your app secret'
},
// Provice if you want to using the Official Account Open APIs
oa: {
oaid: 'xxxxxxxxxxxxxxxx',
secretkey: 'your secret key'
}
}
)
fastify.get('/', async (request, reply) => {
// fastify.ZSClient
// fastify.ZOAClient
return { hello: 'universe' }
})
fastify.listen(3000, err => {
if (err) throw err
console.log('Server listenting on localhost:', fastify.server.address().port)
})