BetaJS Mock File Server for Testing
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docsrc/common Initial commit Nov 27, 2016
src Upload using file field from in request object Apr 15, 2018
tasks Initial commit Nov 27, 2016
.codeclimate.yml JSONP Support Dec 5, 2016
.gitignore Procfile Nov 27, 2016
Gruntfile.js Versioning Update Jan 15, 2017
LICENSE Initial commit Nov 27, 2016
Procfile Procfile Nov 27, 2016
README.md Typo Jan 31, 2017
package-source.json Typo Jan 31, 2017
package.json Typo Jan 31, 2017
server.js Procfile Nov 27, 2016

README.md

mock-file-server 0.1.16

Code Climate NPM

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-server

You can then run the server as follows:

node node_modules/mock-file-server/server.js

You 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 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

Links

Resource URL
Homepage https://github.com/betajs/mock-file-server
Git git://github.com/betajs/mock-file-server.git
Repository https://github.com/betajs/mock-file-server
Blog http://blog.betajs.com
Twitter http://twitter.com/thebetajs

Compatability

Target Versions
NodeJS 0.10 - Latest

Main Contributors

  • Oliver Friedmann

License

Apache-2.0