0.0.1 • Published 6 years ago
hapi-upyun v0.0.1
config
{
plugin: 'hapi-upyun',
options: {
username: 'your username of upyun',
password: 'your password',
domain: 'url prefix',
bucket: 'bucket'
}
}
useage
// const Joi = require('joi')
module.exports = ({ server }) => {
const { upload } = server.plugins['hapi-upyun']
return {
tags: ['api'],
description: '生成上传又拍云时需要的参数',
async handler (request, h) {
const data = upload.getBodyParams({ date: new Date() })
return data
}
}
}