Microexpresscion is an SCXML orchestration server designed to be run on nodejs IoT devices, like the Intel Edison development board.
Microexpresscion provides Node.js express middleware which implements the State Machines as a Service (SMaaS) REST protocol.
npm install -g microexpresscion
microexpresscion path/to/scxml
Open http://localhost:3000/
in your web browser to view the web dashboard.
See bin/www
for example of the JavaScript API.
var microexpresscion = require('../index');
var http = require('http');
microexpresscion.initExpress(pathToScxml,function(err, app){
if(err) throw err;
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
console.log('Listening on ' + bind);
}
});