0.1.17 • Published 5 years ago
mock-file-server v0.1.17
mock-file-server 0.1.16
BetaJS Mock File Server for Testing
Getting Started
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.
npm install mock-file-serverYou can then run the server as follows:
node node_modules/mock-file-server/server.jsYou can also run it as a grunt task.
Basic Usage
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 namefile - POST
/chunk/:filename: stores a single chunk with field namefilewith 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
Links
Compatability
| Target | Versions |
|---|---|
| NodeJS | 0.10 - Latest |
Main Contributors
- Oliver Friedmann
License
Apache-2.0