Crates.io | crud-file-server |
lib.rs | crud-file-server |
version | 0.3.0 |
source | src |
created_at | 2021-04-07 22:50:08.012184 |
updated_at | 2021-04-12 01:03:52.245728 |
description | A simple HTTP file server with POST, GET, PUT, PATCH and DELETE methods |
homepage | |
repository | https://gitlab.com/rasmusmerzin/crud-file-server |
max_upload_size | |
id | 380587 |
size | 62,707 |
A simple HTTP file server with POST, GET, PUT, PATCH and DELETE methods.
DIRECTORY
– directory path to write to and read files fromDIRECTORY=content
SERVER_ADDR
– server socket addressSERVER_ADDR=0.0.0.0:8000
Start
$ cargo run
Create (upload)
$ curl localhost:8000 -d Hello
3718021f-1c23-4dcb-9a90-6d1a74709744
Read (download)
$ curl localhost:8000/3718021f-1c23-4dcb-9a90-6d1a74709744
Hello
Update (overwrite)
$ curl localhost:8000/3718021f-1c23-4dcb-9a90-6d1a74709744 -X put -d Hey
$ curl localhost:8000/3718021f-1c23-4dcb-9a90-6d1a74709744
Hey
Update (append)
$ curl localhost:8000/3718021f-1c23-4dcb-9a90-6d1a74709744 -X patch -d ', World!'
$ curl localhost:8000/3718021f-1c23-4dcb-9a90-6d1a74709744
Hey, World!
Delete
$ curl localhost:8000/3718021f-1c23-4dcb-9a90-6d1a74709744 -X delete
$ docker run -p 8000:8000 rasmusmerzin/crud-file-server
$ cargo install crud-file-server