Example of a simple application using WebSocket and Node.js to create a Python 3 process to calculate the factorial of a number and send the result to client.
Ready for deployment to Heroku.
Simple HTML page with the libraries:
- jQuery;
- Bootsrap;
- ReconnectingWebSocket: keep the connection alive if eventually is dropped.
- Node.js;
- Express framework;
- Python 3: used to do the dirty work (Python process invoked by Node child_process module);
- ws: a Node.js WebSocket library.
node app.js
and navigate to:
localhost:3746