Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NonSwag authored Oct 3, 2024
1 parent 402dde7 commit c3dd433
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,40 +77,66 @@ All routes will be available at the exposed port (e.g. `localhost:3000`).

### Get files as base64

**GET `INSTANCE_URL/base64/:download_key`**: get the file bytes as base64 encoded string
**GET `INSTANCE_URL/base64/{download_key}`**: get the file bytes as base64 encoded string

```sh
curl --request GET 'http://localhost:3000/base64/db6186c8795740379d26fc61ecba1a24'
```
response:

| Code | Meaning |
|------|------------------------------------|
| 200 | Success |
| 404 | File was not found in the database |
| 500 | A server error occurred |

response body: `base64 string`

### Get file size

**GET `INSTANCE_URL/size/{download_key}`**: get the file size

```sh
curl --request GET 'http://localhost:3000/expiration/db6186c8795740379d26fc61ecba1a24'
```
response:

| Code | Meaning |
|------|------------------------------------|
| 200 | Success |
| 404 | File was not found in the database |
| 500 | A server error occurred |

success body: `43554` (in bytes)

### Get file expiration

**GET `INSTANCE_URL/expiration/:download_key`**: get the file expiration date
**GET `INSTANCE_URL/expiration/{download_key}`**: get the file expiration date

```sh
curl --request GET 'http://localhost:3000/expiration/db6186c8795740379d26fc61ecba1a24'
```

response:

| Code | Meaning |
|------|------------------------------------|
| 200 | Success |
| 404 | File was not found in the database |
| 500 | A server error occurred |

success body: `2717940582741` (in millis)

### Set file expiration

**PUT `INSTANCE_URL/expiration/:delete_key/:expiration`**: set the file expiration date
**PUT `INSTANCE_URL/expiration/{delete_key}/{expiration}`**: set the file expiration date

```sh
curl --request PUT 'http://localhost:3000/expiration/11561161dffe4a1298992ce063be5ff9/2717940582741'
```

response:

| Code | Meaning |
|------|------------------------------------|
| 200 | Expiration updated |
Expand Down Expand Up @@ -149,7 +175,7 @@ not the `delete_key`.

### Rename a file

**PUT `INSTANCE_URL/rename/:deletion_key/:name`**: rename a file with the given `deletion_key` ; example:
**PUT `INSTANCE_URL/rename/{deletion_key}/{name}`**: rename a file with the given `deletion_key` ; example:

```sh
curl --request PUT 'http://localhost:3000/rename/11561161dffe4a1298992ce063be5ff9/renamed-plot.schem'
Expand All @@ -164,7 +190,7 @@ response:

### Download a file

**GET `INSTANCE_URL/download/:download_key`**: download a file with the given `download_key`; example:
**GET `INSTANCE_URL/download/{download_key}`**: download a file with the given `download_key`; example:

```sh
curl --request GET 'http://localhost:3000/download/db6186c8795740379d26fc61ecba1a24'
Expand All @@ -183,7 +209,7 @@ On success, the file is sent as an attachment for download to the browser / requ

### Delete a file

**DELETE `PUBLIC_URL/delete/:delete_key`**: delete a file with the given `delete_key`; example:
**DELETE `PUBLIC_URL/delete/{delete_key}`**: delete a file with the given `delete_key`; example:

```sh
curl --request DELETE 'http://localhost:3000/delete/11561161dffe4a1298992ce063be5ff9'
Expand Down

0 comments on commit c3dd433

Please sign in to comment.