aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorMichael Grote2023-04-13 14:50:46 +0200
committerMichael Grote2023-04-13 14:50:46 +0200
commit82d24e97737401363b7b6e4b930214ec9bfe0c0b (patch)
tree2ff33989571f7ed63781cdd2a8a13964f1acdab1 /README.md
parent4751e6f5d43bf3d2a3fbb485eb9b9340969f23cf (diff)
add docs
Diffstat (limited to 'README.md')
-rw-r--r--README.md91
1 files changed, 89 insertions, 2 deletions
diff --git a/README.md b/README.md
index 77a8548..9cdd0be 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,92 @@
-# wsgi server
+# python-api-server
+## Variables
-# dateinmit sleben namen werden überschrieben
+``MAX_CONTENT_LENGTH``: maximal Filesize in MB; defaults to 5MB
+``UPLOAD_DIRECTORY``: where to store the uploaded files; should be mapped to a volume; defaults to "/uploads"
+``AUTH_TOKEN``: token used for authenticating
+
+## ToDo
+
+- [ ] wsgi server
+
+## Example Docker-Compose
+
+see [docker-compose.yml](./docker-compose.yml)
+
+## API-Endpoints
+
+### /list
+
+#### input
+
+```bash
+curl -H "token: myuploadtoken" http://docker10.host.lan:5040/list | jq
+```
+
+#### output
+
+```bash
+{
+ "files": [
+ {
+ "last_modified": "2023-04-13 11:43:51",
+ "name": "file1",
+ "size": 1034
+ },
+ {
+ "last_modified": "2023-04-13 11:53:59",
+ "name": "file2",
+ "size": 5
+ },
+ {
+ "last_modified": "2023-04-13 12:41:18",
+ "name": "file3",
+ "size": 3478
+ }
+ ]
+}
+```
+
+### /upload
+
+If a file is uploaded with the same name as an existing file, it will be overwritten.
+
+#### input
+
+```bash
+curl -X POST -H "token: myuploadtoken" -F "file=@tests/file" http://docker10.host.lan:5040/upload | jq
+```
+
+#### output
+
+```bash
+{
+ "success": "File 'file' successfully uploaded"
+}
+```
+
+### /download
+
+#### input
+
+```bash
+wget http://docker10.host.lan:5040/download/file
+```
+
+### /delete
+
+#### input
+
+```bash
+curl -X DELETE -H "token: myuploadtoken" http://docker10.host.lan:5040/delete/file | jq
+```
+
+#### output
+
+```bash
+{
+ "success": "File 'file' successfully deleted"
+}
+```