HUB
Sign inSign up

aureliengasser/http-folder

By aureliengasser

•Updated almost 7 years ago

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

Image
0

10K+

aureliengasser/http-folder repository overview

⁠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 /tmp/files
$ http-folder /tmp/files 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
Uploaded succesfully$

# 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⁠

Tag summary

Content type

Image

Digest

Size

37.4 MB

Last updated

almost 7 years ago

docker pull aureliengasser/http-folder