本文整理匯總了TypeScript中hapi-decorators.put函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript put函數的具體用法?TypeScript put怎麽用?TypeScript put使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了put函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: updateUserApi
@put('/{id}')
@config({
auth: 'jwt'
})
updateUserApi(request: hapi.Request, reply: hapi.IReply) {
reply(boom.notImplemented());
}
示例2: renew
@put('/')
@config({ auth: 'jwt' })
renew(request: hapi.Request, reply: hapi.IReply) {
const oldToken = request.auth['token'];
const token = renewAuthentication(oldToken);
reply({ token });
}
示例3: updatePostApi
@put('/{id}')
@config({
auth: 'jwt'
})
updatePostApi(request: hapi.Request, reply: hapi.IReply) {
let post = request.payload;
savePost(post).then(data => {
reply({ message: 'saved', data });
}).catch((err: Error) => {
if (err.name === 'SequelizeConnectionError') {
reply(boom.create(503, 'Bad Connection'));
} else {
reply(boom.create(503, err.message));
}
});
}
示例4: updateWebhookApi
@put('/{id}')
@config({
auth: 'jwt'
})
updateWebhookApi(request: hapi.Request, reply: hapi.IReply) {
// let webhook = request.payload;
// updateWebhook(webhook).then(data => {
// reply({ message: 'saved', data });
// }).catch((err: Error) => {
// if (err.name === 'SequelizeConnectionError') {
// reply(boom.create(503, 'Bad Connection'));
// } else {
// reply(boom.create(503, err.message));
// }
// });
reply(boom.notImplemented());
}
示例5: putHandler
@put('/{id}')
putHandler(request: hapi.Request, reply: hapi.ReplyNoContinue) {
reply({ success: true });
}
示例6: putHandler
@put('/{id}')
putHandler(request: hapi.Request, reply: hapi.IReply) {
reply({ success: true });
}