docs(readme): reorder sections in README.md

This commit is contained in:
Orhun Parmaksız 2022-03-17 11:53:16 +03:00
parent 2d5c14a6e0
commit 51d6fdd0d8
No known key found for this signature in database
GPG key ID: F83424824B3E4B90

View file

@ -99,17 +99,6 @@ $ curl -F "file=@x.txt" -H "expire:10min" "<server_address>"
$ curl -F "oneshot=@x.txt" "<server_address>" $ curl -F "oneshot=@x.txt" "<server_address>"
``` ```
#### Cleaning up expired files
```sh
#!/bin/env sh
now=$(date +%s)
find upload/ -maxdepth 2 -type f -iname "*.[0-9]*" |
while read -r filename; do
[ "$(( ${filename##*.} / 1000 - "${now}" ))" -lt 0 ] && rm -v "${filename}"
done
```
#### URL shortening #### URL shortening
```sh ```sh
@ -122,6 +111,17 @@ $ curl -F "url=https://example.com/some/long/url" "<server_address>"
$ curl -F "remote=https://example.com/file.png" "<server_address>" $ curl -F "remote=https://example.com/file.png" "<server_address>"
``` ```
#### Cleaning up expired files
```sh
#!/bin/env sh
now=$(date +%s)
find upload/ -maxdepth 2 -type f -iname "*.[0-9]*" |
while read -r filename; do
[ "$(( ${filename##*.} / 1000 - "${now}" ))" -lt 0 ] && rm -v "${filename}"
done
```
### Server ### Server
To start the server: To start the server: