express-rest-file-server

1.1.0 • Public • Published

express-rest-file-server

Build Status Commitizen friendly Version npm npm Downloads

NPM

An express based application, inspired by mock-file-server, to be used as a CRUD file server storing content in the memory (temporal) or in the disk (permanent) of the server.

Usage

You can either install it globally o locally to your project

# global installation 
npm install -g express-rest-file-server
# local installation 
npm install express-rest-file-server

To start using it with default options, just run

# global installation 
express-rest-file-server
# local installation 
npx express-rest-file-server

Options

  • port: defaults to 5000
  • storageType: can be memory or disk (defaults to memory)
  • storagePath: where to store the files if storage is set to disk (defaults to /tmp)

Routes

POST /files

Uploads a file to the store with its original name

POST /files/:filename

Uploads a file to the store with a custom name (:filename)

POST /files/chunk/:filename

Uploads a chuck of a file to the store with a custom name (:filename)

POST /files/assemble/:filename

Builds a file from its chunks

GET /files/:filename

Retrieve a file by its name

GET /files/:filename/size

Retrieve a file size by its name

DELETE /files/:filename

Remove a file by its name

Package Sidebar

Install

npm i express-rest-file-server

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

16.6 kB

Total Files

9

Last publish

Collaborators

  • fcallem