mkdir fubar
cd fubar
npm init .
# Don't forget to specify the test command like 'exit 0'
npm install --save elasticio-sailor-nodejs
npm install --save fibonacci-fast
# Copy files above
echo "node_modules" > .gitignore
git init .
git add * .gitignore
git commit -a -m 'Initial commit'
git remote add xpc [email protected]:XXX
git push xpc master
Last active
February 7, 2018 22:14
-
-
Save zubairov/727014cd627e1bef23a4d64aaab74d6e to your computer and use it in GitHub Desktop.
Simples e.io component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Sample Component", | |
"description": "Minimal component for demo purposes", | |
"actions": { | |
"fibonacci": { | |
"title": "Fibonacci", | |
"description": "Compute fibonacci number", | |
"main": "./index.js" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fibonacci = require('fibonacci-fast'); | |
module.exports.process = async function process(msg) { | |
const number = msg.body.number || 10; | |
return { | |
body: { | |
result: fibonacci.get(number) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment