actionhero
Version:
actionhero.js is a multi-transport API Server with integrated cluster capabilities and delayed tasks
17 lines (13 loc) • 417 B
JavaScript
exports.randomNumber = {
name: 'randomNumber',
description: 'I am an API method which will generate a random number',
outputExample: {
randomNumber: 0.123
},
run: function (api, data, next) {
data.response.randomNumber = Math.random()
data.response.stringRandomNumber = data.connection.localize(['Your random number is {{number}}', {number: Math.random()}])
next(null)
}
}