Full stack solution to file uploading, with backend express and front-end AMD support.
Transports data via primarily via websockets and utilizes the browser FileReader api. The
ws library is used to listen to ws://.../upper to establish a file upload queue between the client and the server.
Server side code:
var app =server =// pass a server instance to establish websocket connectionupper = server: server ;// serve client side code and using expressjs middleware pluginapp;// Get all complete uploaded files in once place:upper;
// Create upper listener instance to file input elementvar upper =uploader = upper// get callback with preview url// get notified of upload progress;// event on completed image upload// - you can pass back data from the server here// This is useful for passing back data like save location etc;
The project is built using browserify to maximise modularity since much of the code is applicable on both the backend and the frontend. To run and build all frontend files run
npm run build. This witll populate the
./lib/static/dist folder with all the frontend code as well as minified versions.
For local tests run
npm test to run the full suite.