node.js micro-services used by bestof.js.org web application.
Each micro-service is either a plain JavaScript function either a basic Express web server deployed on webtask.io.
Requirement: sign up to webtask.io (using your Github account for example).
STEP 1. Create a basic JavaScript file with a callback that returns a JSON object.
module.exports = function (cb) {
var json = {
status: 'OK'
};
cb(null, json);
};STEP 2. Install the command line tool
npm install wt-cli -g
STEP 3. Login from the command line
wt init ****r@gmail.com
STEP 4. Check your email and enter the verification number (6 digits).
STEP 5. Create the webtask, from the local JavaScript file.
wt create index.js
=> an URL is generated to launch the webtask!
curl https://webtask.it.auth0.com/api/run/wt-mikeair-gmail_com-0/index
?webtask_no_cache=1
Each folder contains the code for a given micro-service.
- get-github-readme: return a formatted README.md for a given Github project
- user-content-api: REST API used to create/edit content generated by users (reviews and links)
There are at least 2 JavaScript files in each folder:
<micro-service-name>.jsthe code of the micro-service uploaded to webtask.ioindex.js(or index.coffee) used to run the service locally, from the command line.