Sign inSign up

joaquinito01/http_file_server

By joaquinito01

•Updated almost 8 years ago

Http File Server - Download, Upload, And Delete

Image
0

279

joaquinito01/http_file_server repository overview

⁠HTTP File Server

Test project.

⁠Description

HTTP File Server - server, providing http API for downloading, uploading and removing files by their md5 hash string. All files store in directory, which is setting up from the config file.

⁠HTTP API

⁠Health
GET /health

Response:

200 OK
⁠Upload

Uploading file to the server. File is setting up by the form, field "upload".

POST /upload
Content-Type: multipart/form-data

Response:

200 OK

"file hash"
⁠Download

Downloading file from the server.

POST /download/{file_hash}

Response:

200 OK

"file data"
⁠Delete

Removing file by his md5 hash.

POST /delete/{file_hash}

Response:

200 OK

ok

⁠Local launch

⁠Requirements

You need to have vgo installed.

go get -u golang.org/x/vgo
⁠Launch
  1. Clone the repository.
  2. Install dependencies, create the config file.
  3. Create static files directory, based on config file.
  4. Launch the project.
git clone https://github.com/lillilli/http_file_server.git && cd http_file_server
make setup && make config
mkdir -p shared/static
make run
⁠Docker
  1. Clone the repository.
  2. Make image (need some time).
  3. Launch image (will be available on localhost:8080).
git clone https://github.com/lillilli/http_file_server.git && cd http_file_server
make image
make run:image

Tag summary

Content type

Image

Digest

Size

5.5 MB

Last updated

almost 8 years ago

docker pull joaquinito01/http_file_server