A routes.js file allows a developer to host REST API routes on the XIBLE API endpoint.

Since XIBLE exposes an express.js router, their docs are applicable here.


Internally, every node saved in a flow gets its own _id parameter. This _id is key to where the node API router is hosted;



'use strict';// export a function to run when XIBLE startsmodule.exports = (NODE, ROUTER) => {  // setup a simple GET route  ROUTER.get('/hello', (req, res) => {    res.json({ hello: 'world' });  });  // handle some input  ROUTER.put('/data', (req, res) => {    // store the data in the vault    // this will now be available in the node through NODE.data.data    NODE.vault.set({ data: req.body.data });    res.end();  });};