1.1.1 • Published 4 years ago

http-folder v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

HTTP Folder

A simple web server with file upload and download, written in Node.js

npm version

nodesource/node

TL;DR

  • POST /my-file to upload a file
  • GET /my-file to download a file
  • DELETE /my-file to delete a file
  • GET / to list the files

There are no subfolders, only one root folder.

Dependencies

None

Installation

Install locally:

npm install -g http-folder

On kubernetes, you can use the public helm repository.

Usage

# Start the server
$ mkdir files
$ http-folder /tmp/data 4242
Serving /tmp/files on port 4242
# or HTTP_FOLDER_ROOT_DIR=/tmp/files HTTP_FOLDER_PORT=4242 http-folder

# Upload
$ cat original-file
some content
$ curl --data-binary "@original-file" http://localhost:4242/uploaded-file

# Download
$ curl -s http://localhost:4242/uploaded-file -o downloaded-file
$ cat downloaded-file
some content

# Delete
$ curl -XDELETE http://localhost:4242/uploaded-file
Deleted successfully$

Acknowledgements

Largely based on https://github.com/krvikash35/nodejs-download-upload-server