A lightweight upload microservice
| Name | Required | Example |
|---|---|---|
| BASE_URL | yes | http://your-base-url.com |
| SECRET_KEY | no | 123 |
| SECRET_JWT | no | awesome-secret |
Your hosting will be concatenated to the top of the directory to access the files.
Token for upload authentication, if not informed upload will be public.
In request send header Secret-Key
Secret key for JWT encryptor
| Name | Required |
|---|---|
| /storage | yes |
Volume used to save files
.env
BASE_URL=http://localhost:3000
SECRET_KEY=123
SECRET_JWT=my-secret
docker-compose.yml
version: '3.7'
services:
app:
image: paliari/upload-service
ports:
- 3000:3000
volumes:
- storage:/storage
env_file: .env
volumes:
storage:
/healthRoute for check health
Content-Type: application/json
application/json)
{
"version": "1.0.0",
"applicationName": "Upload Service"
}
/jwtRoute for get a jwt token to authenticate upload. Send this token in Authorization header.
Content-Type: application/json
Headers
| Name | Required | Type |
|---|---|---|
| Secret-Key | yes | string |
application/json)
{
"token": "jwt.example.token"
}
/Route for file uploads, if authenticated, send JWT token in Authorization header
Content-Type: multipart/form-data
Attributes
| Name | Required | Type |
|---|---|---|
| file | yes | Blob |
Headers
| Name | Required |
|---|---|
| Authorization | If Secret-Key is defined |
application/json)
{
"url": "http://your-base-url.com/storage/2019/12/03/123e4567-e89b-12d3-a456-426655440000.jpeg"
}
cp .env.example .env
yarn docker:test
docker-compose up
Content type
Image
Digest
sha256:7ad15ba80…
Size
30.1 MB
Last updated
over 3 years ago
docker pull paliari/upload-service