http-folder
v1.1.1
Published
A simple web server with file upload and download
Downloads
7
Maintainers
Readme
HTTP Folder
A simple web server with file upload and download, written in Node.js
TL;DR
POST /my-file
to upload a fileGET /my-file
to download a fileDELETE /my-file
to delete a fileGET /
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