BetaJS Mock File Server for Testing
npm install mock-file-server
BetaJS Mock File Server for Testing
This a mock file server for testing uploading and retrieving files.
Files are stored in the memory of the server for a short time and are then removed.
``shell`
npm install mock-file-server
You can then run the server as follows:
`shell`
node node_modules/mock-file-server/server.js
You can also run it as a grunt task.
The server creates the following endpoints:
- GET /files/:filename/size: returns the size of an uploaded file as json {"size": size}
- GET /files/:filename: returns an uploaded file as binary stream
- POST /files/:filename: stores an uploaded single file with field name file
- POST /chunk/:filename: stores a single chunk with field name file with the chunk number being present in the request body
- POST /assemble/:filename: assembles a chunked file, checking the total size with the total size being present in the request body
- Oliver Friedmann
Apache-2.0