Create a root file config.json.
Example local config:
{
"app": {
"url": "http://localhost:3000",
"port": 3000
},
"auth": {
"clients": [
{
"name": "local",
"token": "LOCAL-TEST-AUTH-KEY"
}
]
}
}Private requests must include auth headers:
headers: {
Authorization: `${client} ${token}`,
}Files are stored per client.
Private request
POST request to /u with FormData headers and body.
Response:
{
"filename": "joy.png",
"url:" "https://hosting.example.com/f/local/joy.png"
}Private request
POST request to /dl.
Example body:
[
{
"filename": "joy.png",
"url:" "https://someremotesite.com/image.png"
},
]Response:
[
{
"filename": "joy.png",
"url:" "https://hosting.example.com/f/local/joy.png"
},
]Private request
GET request to /f.
Response:
[
{
"filename": "joy.png",
"url:" "https://hosting.example.com/f/local/joy.png"
},
]Private request
GET request to /f/:filename.
Example: https://hosting.example.com/f/joy.png
Response:
{
"filename": "joy.png",
"url:" "https://hosting.example.com/f/local/joy.png"
}Public request
GET request to /f/:client/:filename.
Example: https://hosting.example.com/v/local/joy.png
Response:
🖼️
Private request
DELETE request to /f/:filename.
Example: https://hosting.example.com/f/joy.png
Response:
Private request
DELETE request to /f.
Response: